aboutsummaryrefslogtreecommitdiff
path: root/src/internal/poll
AgeCommit message (Collapse)Author
2023-02-09runtime: fix signature for linked functionsAdin Scannell
These functions are linked using go:linkname, but do not match the original declarations. This change brings these in sync. Change-Id: I16651304c3dba2f9897c2c42e30555d2f7805c2a Reviewed-on: https://go-review.googlesource.com/c/go/+/466615 Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Michael Pratt <mpratt@google.com>
2023-02-02internal/poll: use atomic.Bool in DupCloseOnExecTobias Klauser
Invert the meaning of the var to make use of the zero value. Change-Id: If18db09896a67cb37cb3fe7dc0fb3493c6050a87 Reviewed-on: https://go-review.googlesource.com/c/go/+/463847 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2023-01-30internal/poll: don't queue port completion entry for udp on windowsqmuntal
This CL sets the FILE_SKIP_COMPLETION_PORT_ON_SUCCESS notification mode for all udp and tcp networks. When SetFileCompletionNotificationModes was implemented, back in go 1.2 [1], it was not possible to enable this mode on udp connections because it is buggy on Windows 7 and earlier. The bug was fixed on Windows 8. We can safely enable this mode now, since go 1.21 will require Windows 10 or higher. While here, I noticed that this mode is only enabled for tcp, but not for tcp4 nor tcp6. I don't think this restriction makes sense, so I'm lifting it. The performance gains are relevant: name old time/op new time/op delta ReadWriteMsgUDPAddrPort-12 13.3µs ± 4% 11.2µs ± 8% -15.90% (p=0.000 n=10+9) WriteToReadFromUDP-12 14.5µs ±18% 11.4µs ± 4% -21.35% (p=0.000 n=10+9) WriteToReadFromUDPAddrPort-12 13.4µs ± 3% 11.0µs ± 2% -18.00% (p=0.000 n=10+9) [1] https://codereview.appspot.com/12409044 Change-Id: Idf41c35898beceac39d21decb47910f7d8ac247b Reviewed-on: https://go-review.googlesource.com/c/go/+/463839 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-12-16syscall, internal/poll: fall back to accept on linux-armIan Lance Taylor
Our minimum Linux version is 2.6.32, and the accept4 system call was introduced in 2.6.28, so we use accept4 everywhere. Unfortunately, it turns out that the accept4 system call was only added to linux-arm in 2.6.36, so for linux-arm only we need to try the accept4 system call and then fall back to accept if it doesn't work. The code we use on linux-arm is the code we used in Go 1.17. On non-arm platforms we continue using the simpler code introduced in Go 1.18. Adding accept4 to the ARM Linux kernel was: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=21d93e2e29722d7832f61cc56d73fb953ee6578e Fixes #57333 Change-Id: I6680cb54dd4d3514a6887dda8906e6708c64459d Reviewed-on: https://go-review.googlesource.com/c/go/+/457995 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-11-14os,syscall: File.Stat to use file handle for directories on Windowsqmuntal
Updates syscall.Open to support opening directories via CreateFileW. CreateFileW handles are more versatile than FindFirstFile handles. They can be used in Win32 APIs like GetFileInformationByHandle and SetFilePointerEx, which are needed by some Go APIs. Fixes #52747 Fixes #36019 Change-Id: I26a00cef9844fb4abeeb18d2f9d854162a146651 Reviewed-on: https://go-review.googlesource.com/c/go/+/405275 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Patrik Nyblom <pnyb@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Quim Muntal <quimmuntal@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-11-09io: correctly process result of sendfile(2) when src returns 0 bytesDaulet Zhanguzin
Fixes #53658. io.Copy() uses sendfile(2) to avoid allocating extra buffers when src is a file and dst is a TCPConn. However if src returns no bytes current logic treats it as failure and falls back to copying via user space. The following is a benchmark that illustrates the bug. Benchmark: https://go.dev/play/p/zgZwpjUatSq Before: BenchmarkCopy-16 541006 2137 ns/op 4077 B/op 0 allocs/op After: BenchmarkCopy-16 490383 2365 ns/op 174 B/op 8 allocs/op Change-Id: I703376d53b20e080c6204a73c96867cce16b24cf GitHub-Last-Rev: 3a50be4f169683bf9caea32892c66619a66ad21a GitHub-Pull-Request: golang/go#53659 Reviewed-on: https://go-review.googlesource.com/c/go/+/415834 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-10-08os: use poll.fdMutex for Plan 9 filesIan Lance Taylor
This permits us to safely support concurrent access to files on Plan 9. Concurrent access was already safe on other systems. This does introduce a change: if one goroutine calls a blocking read on a pipe, and another goroutine closes the pipe, then before this CL the close would occur. Now the close will be delayed until the blocking read completes. Also add tests that concurrent I/O and Close on a pipe are OK. For #50436 For #56043 Change-Id: I969c869ea3b8c5c2f2ef319e441a56a3c64e7bf5 Reviewed-on: https://go-review.googlesource.com/c/go/+/438347 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: David du Colombier <0intro@gmail.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
2022-10-07internal/poll, internal/syscall/unix, syscall: move writev definition for ↵Tobias Klauser
solaris Move the writev definition for solaris from package internal/syscall/unix to package syscall. This corresponds to where writev is defined on aix, darwin and openbsd as well and is go:linkname'ed from internal/poll. This also allows updating the generated wrappers more easily if needed. Change-Id: I671ed8232d25319f8e63f549f786d77a17602148 Reviewed-on: https://go-review.googlesource.com/c/go/+/436597 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2022-10-07internal/poll, net, syscall: enable writev on aixTobias Klauser
aix supports iovec read/write, see https://www.ibm.com/docs/en/aix/7.2?topic=w-write-writex-write64x-writev-writevx-ewrite-ewritev-pwrite-pwritev-subroutine Define an unexported writev wrapper in package syscall (like on openbsd and darwin) and linkname it from internal/poll. Change-Id: I8f9695ceac72ae861afa3692207c154d86d4e690 Reviewed-on: https://go-review.googlesource.com/c/go/+/435260 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2022-09-30internal: fix a few function names on commentscui fliter
Change-Id: I53169e386b8c789b092de348fa891fe50e11c2ef GitHub-Last-Rev: 75232393b4ba415bddc731f15550d7094ccfd953 GitHub-Pull-Request: golang/go#55965 Reviewed-on: https://go-review.googlesource.com/c/go/+/436883 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-09-09internal/poll, syscall: convert writev to direct libc call on openbsd ↵Tobias Klauser
(except mips64) Add and use a writev libc wrapper instead of using syscall(2). Updates golang/go#36435 Change-Id: I3c67665388ac276d9ef36868e368e91efb92800e Reviewed-on: https://go-review.googlesource.com/c/go/+/428776 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Joel Sing <joel@sing.id.au> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-09-09internal/poll: drop redundant ENOSYS in CopyFileRangeAndy Pan
Update CL 425881 and CL 428396 I browsed the source code related to copy_file_range in the kernel and found that the latest kernel may still return EXDEV errors in copy_file_range(2) due to certain cases, for details see: https://elixir.bootlin.com/linux/v5.19.7/source/fs/read_write.c#L1559, https://elixir.bootlin.com/linux/v5.19.7/source/fs/read_write.c#L1479, and https://elixir.bootlin.com/linux/v5.19.7/source/fs/read_write.c#L1439. Therefore, the EXDEV still needs to be kept, but the ENOSYS error can be safely removed. Change-Id: I47026b8dd33f7ffc4de1306af6b67c7b4d2062d2 Reviewed-on: https://go-review.googlesource.com/c/go/+/428555 Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Andy Pan <panjf2000@gmail.com>
2022-09-06internal/poll, internal/syscall/unix, net: enable writev on solarisTobias Klauser
The writev syscall is available since at least Solaris 11.3. Reuse the existing illumos writev wrapper on solaris to implement internal/poll.writev for net.(*netFD).writeBuffers. Change-Id: I23adc3bb4637740c72bfb61bfa9697b432dfe3db Reviewed-on: https://go-review.googlesource.com/c/go/+/427714 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-09-06Revert "internal/poll: drop redundant ENOSYS and EXDEV error checks in ↵Daniel Martí
CopyFileRange()" This reverts https://go.dev/cl/425881. Reason for revert: broke make.bash on linux/amd64 with Linux 5.19.6. [...] Building Go toolchain2 using go_bootstrap and Go toolchain1. go install internal/unsafeheader: copying /tmp/go-build4206185186/b007/_pkg_.a to /home/mvdan/tip/pkg/linux_amd64/internal/unsafeheader.a: write /home/mvdan/tip/pkg/linux_amd64/internal/unsafeheader.a: copy_file_range: invalid cross-device link go install internal/goarch: copying /tmp/go-build4206185186/b006/_pkg_.a to /home/mvdan/tip/pkg/linux_amd64/internal/goarch.a: write /home/mvdan/tip/pkg/linux_amd64/internal/goarch.a: copy_file_range: invalid cross-device link [...] Change-Id: I793856935d4315a870c2d31da46be00cc342b5f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/428396 Reviewed-by: Wayne Zuo <wdvxdr@golangcn.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: hopehook <hopehook@golangcn.org> Reviewed-by: Andy Pan <panjf2000@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
2022-09-05internal/poll: drop redundant ENOSYS and EXDEV error checks in CopyFileRange()Andy Pan
The initial CL 229101 didn't limit the kernel version, but relies on error checking to ensure the kernel version >= 4.5 or >= 5.3 when it's calling copy_file_range(2) to copy data across file systems. Since we have now put the kernel version checking at the beginning of the function, introduced by CL 268338, which returns early instead of going forward to the code behind when the kernel verion is older than 5.3, therefore, those subsequent related error checks are no longer needed. Change-Id: Ifc4a530723e21f0bde91d6420cde9cb676081922 Reviewed-on: https://go-review.googlesource.com/c/go/+/425881 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: hopehook <hopehook@golangcn.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-09-03internal/syscall/unix: consolidate kernelVersion implementationsKir Kolyshkin
Currently, there are 3 functions returning Linux kernel version numbers. Two of them are identical: - in net, initially added by commit 0a9dd47dd817904e; - in internal/poll, initially added by commit 1c7650aa93bd53; (both were later fixed by commit 66c02645062561a). The third one is a more complex, regexp-based implementation in runtime/pprof, which is only used for a test. Instead of adding one more, let's consolidate existing ones. Remove the complex implementation, and move the simple one into internal/syscall/unix. Use it from all the three places mentioned above. Change-Id: I4a34d9ca47257743c16def30e4dd634e36056091 Reviewed-on: https://go-review.googlesource.com/c/go/+/424896 Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-31internal/poll, internal/syscall/unix, net, runtime: convert openbsd (except ↵Tobias Klauser
mips64) to direct libc calls Call libc wrappers directly rather than calling using syscall(2). Updates golang/go#36435 Change-Id: I40be410c7472f7d89cbec2ebdc7c841c7726ca4a Reviewed-on: https://go-review.googlesource.com/c/go/+/425637 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Joel Sing <joel@sing.id.au>
2022-08-29internal/poll: use sync.Once instead to guard CopyFileRange() with kernel 5.3Andy Pan
The existing implementation creates more branches with more states: -1, 0, 1, which makes it not very intuitive to understand, let's use sync.Once and boolean instead to make it more straightforward. Change-Id: I05766e5fdf7dba37d6565f84d3db4373f9342fe5 Reviewed-on: https://go-review.googlesource.com/c/go/+/425880 Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-08-26internal/poll: optimize the maximum amount of bytes that can be transferred ↵Andy Pan
by one splice(2) call Fixes #40222 name old time/op new time/op delta Splice/tcp-to-tcp/1024-4 5.16µs ± 1% 5.17µs ± 4% ~ (p=0.481 n=10+10) Splice/tcp-to-tcp/2048-4 5.46µs ± 2% 5.48µs ± 2% ~ (p=0.617 n=10+10) Splice/tcp-to-tcp/4096-4 6.07µs ± 3% 6.09µs ± 5% ~ (p=0.927 n=10+10) Splice/tcp-to-tcp/8192-4 7.07µs ± 5% 7.16µs ± 3% ~ (p=0.324 n=10+10) Splice/tcp-to-tcp/16384-4 8.82µs ±10% 8.83µs ±11% ~ (p=1.000 n=10+10) Splice/tcp-to-tcp/32768-4 12.3µs ±12% 12.7µs ± 4% ~ (p=0.268 n=10+9) Splice/tcp-to-tcp/65536-4 22.1µs ± 3% 22.0µs ± 3% ~ (p=0.912 n=10+10) Splice/tcp-to-tcp/131072-4 40.0µs ± 4% 39.9µs ± 4% ~ (p=1.000 n=9+8) Splice/tcp-to-tcp/262144-4 69.1µs ± 3% 67.9µs ± 2% -1.67% (p=0.010 n=9+10) Splice/tcp-to-tcp/524288-4 128µs ± 3% 124µs ± 2% -2.67% (p=0.001 n=9+10) Splice/tcp-to-tcp/1048576-4 242µs ± 3% 242µs ± 2% ~ (p=0.912 n=10+10) Splice/unix-to-tcp/1024-4 1.97µs ± 3% 1.96µs ± 2% ~ (p=0.342 n=10+10) Splice/unix-to-tcp/2048-4 2.19µs ± 2% 2.21µs ± 2% ~ (p=0.150 n=9+10) Splice/unix-to-tcp/4096-4 2.52µs ± 5% 2.50µs ± 1% ~ (p=0.393 n=10+10) Splice/unix-to-tcp/8192-4 3.27µs ± 4% 3.24µs ± 7% ~ (p=0.968 n=9+10) Splice/unix-to-tcp/16384-4 4.68µs ± 9% 4.79µs ± 8% ~ (p=0.739 n=10+10) Splice/unix-to-tcp/32768-4 7.82µs ±12% 7.76µs ±12% ~ (p=0.912 n=10+10) Splice/unix-to-tcp/65536-4 17.9µs ± 3% 17.3µs ±10% ~ (p=0.661 n=9+10) Splice/unix-to-tcp/131072-4 35.9µs ± 1% 31.3µs ± 4% -12.88% (p=0.000 n=10+9) Splice/unix-to-tcp/262144-4 72.4µs ± 3% 55.4µs ± 2% -23.55% (p=0.000 n=10+10) Splice/unix-to-tcp/524288-4 146µs ± 3% 113µs ± 1% -22.87% (p=0.000 n=9+9) Splice/unix-to-tcp/1048576-4 288µs ± 3% 223µs ± 3% -22.49% (p=0.000 n=10+9) name old speed new speed delta Splice/tcp-to-tcp/1024-4 198MB/s ± 1% 198MB/s ± 4% ~ (p=0.481 n=10+10) Splice/tcp-to-tcp/2048-4 375MB/s ± 2% 374MB/s ± 2% ~ (p=0.631 n=10+10) Splice/tcp-to-tcp/4096-4 674MB/s ± 3% 673MB/s ± 5% ~ (p=0.912 n=10+10) Splice/tcp-to-tcp/8192-4 1.16GB/s ± 6% 1.15GB/s ± 3% ~ (p=0.315 n=10+10) Splice/tcp-to-tcp/16384-4 1.86GB/s ±10% 1.84GB/s ±13% ~ (p=0.720 n=10+9) Splice/tcp-to-tcp/32768-4 2.68GB/s ±13% 2.57GB/s ± 7% ~ (p=0.165 n=10+10) Splice/tcp-to-tcp/65536-4 2.97GB/s ± 3% 2.98GB/s ± 3% ~ (p=0.912 n=10+10) Splice/tcp-to-tcp/131072-4 3.28GB/s ± 4% 3.29GB/s ± 4% ~ (p=1.000 n=9+8) Splice/tcp-to-tcp/262144-4 3.80GB/s ± 3% 3.86GB/s ± 2% +1.70% (p=0.010 n=9+10) Splice/tcp-to-tcp/524288-4 4.10GB/s ± 3% 4.21GB/s ± 2% +2.74% (p=0.001 n=9+10) Splice/tcp-to-tcp/1048576-4 4.34GB/s ± 3% 4.33GB/s ± 2% ~ (p=0.912 n=10+10) Splice/unix-to-tcp/1024-4 519MB/s ± 3% 523MB/s ± 2% ~ (p=0.353 n=10+10) Splice/unix-to-tcp/2048-4 934MB/s ± 2% 926MB/s ± 2% ~ (p=0.156 n=9+10) Splice/unix-to-tcp/4096-4 1.63GB/s ± 5% 1.64GB/s ± 1% ~ (p=0.393 n=10+10) Splice/unix-to-tcp/8192-4 2.51GB/s ± 3% 2.53GB/s ± 7% ~ (p=0.968 n=9+10) Splice/unix-to-tcp/16384-4 3.52GB/s ± 8% 3.43GB/s ± 8% ~ (p=0.739 n=10+10) Splice/unix-to-tcp/32768-4 4.21GB/s ±14% 4.24GB/s ±13% ~ (p=0.912 n=10+10) Splice/unix-to-tcp/65536-4 3.65GB/s ± 5% 3.81GB/s ±11% ~ (p=0.436 n=10+10) Splice/unix-to-tcp/131072-4 3.65GB/s ± 1% 4.19GB/s ± 4% +14.81% (p=0.000 n=10+9) Splice/unix-to-tcp/262144-4 3.62GB/s ± 3% 4.73GB/s ± 2% +30.78% (p=0.000 n=10+10) Splice/unix-to-tcp/524288-4 3.59GB/s ± 3% 4.66GB/s ± 1% +29.64% (p=0.000 n=9+9) Splice/unix-to-tcp/1048576-4 3.65GB/s ± 3% 4.70GB/s ± 3% +29.01% (p=0.000 n=10+9) name old alloc/op new alloc/op delta Splice/tcp-to-tcp/1024-4 0.00B 0.00B ~ (all equal) Splice/tcp-to-tcp/2048-4 0.00B 0.00B ~ (all equal) Splice/tcp-to-tcp/4096-4 0.00B 0.00B ~ (all equal) Splice/tcp-to-tcp/8192-4 0.00B 0.00B ~ (all equal) Splice/tcp-to-tcp/16384-4 0.00B 0.00B ~ (all equal) Splice/tcp-to-tcp/32768-4 0.00B 0.00B ~ (all equal) Splice/tcp-to-tcp/65536-4 0.00B 0.00B ~ (all equal) Splice/tcp-to-tcp/131072-4 0.00B 0.00B ~ (all equal) Splice/tcp-to-tcp/262144-4 0.00B 0.00B ~ (all equal) Splice/tcp-to-tcp/524288-4 0.00B 0.00B ~ (all equal) Splice/tcp-to-tcp/1048576-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/1024-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/2048-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/4096-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/8192-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/16384-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/32768-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/65536-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/131072-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/262144-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/524288-4 0.00B 0.00B ~ (all equal) Splice/unix-to-tcp/1048576-4 0.00B 0.00B ~ (all equal) name old allocs/op new allocs/op delta Splice/tcp-to-tcp/1024-4 0.00 0.00 ~ (all equal) Splice/tcp-to-tcp/2048-4 0.00 0.00 ~ (all equal) Splice/tcp-to-tcp/4096-4 0.00 0.00 ~ (all equal) Splice/tcp-to-tcp/8192-4 0.00 0.00 ~ (all equal) Splice/tcp-to-tcp/16384-4 0.00 0.00 ~ (all equal) Splice/tcp-to-tcp/32768-4 0.00 0.00 ~ (all equal) Splice/tcp-to-tcp/65536-4 0.00 0.00 ~ (all equal) Splice/tcp-to-tcp/131072-4 0.00 0.00 ~ (all equal) Splice/tcp-to-tcp/262144-4 0.00 0.00 ~ (all equal) Splice/tcp-to-tcp/524288-4 0.00 0.00 ~ (all equal) Splice/tcp-to-tcp/1048576-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/1024-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/2048-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/4096-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/8192-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/16384-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/32768-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/65536-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/131072-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/262144-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/524288-4 0.00 0.00 ~ (all equal) Splice/unix-to-tcp/1048576-4 0.00 0.00 ~ (all equal) Change-Id: I899c1fdcb3f7b9997faf2b0d2336016a3f1fd3ea Reviewed-on: https://go-review.googlesource.com/c/go/+/425051 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-08-22internal/poll: rely on utf8.AppendRuneJoe Tsai
This is both simpler and more performant. Change-Id: I398de29230e578fb7caf1765df7b8fe84d4e8876 Reviewed-on: https://go-review.googlesource.com/c/go/+/412336 Run-TryBot: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-18internal/poll: remove fallback path in acceptTobias Klauser
Support for operating system versions requiring the fallback to CloseOnExec/SetNonblock was dropped from recent Go versions. The minimum Linux kernel version is 2.6.32 as of Go 1.18. FreeBSD 10 is no longer supported as of Go 1.13. Follows a similar change for net.sysSocket in CL 403634 and syscall.Socket in CL 422374. For #45964 Change-Id: I60848415742a1d8204e1fda585462ff35ad6722f Reviewed-on: https://go-review.googlesource.com/c/go/+/422375 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-18internal/poll: remove detection of buggy splice on old Linux versionsTobias Klauser
The splice syscall is buggy prior to Linux 2.6.29. CL 113999 added a workaround to detect buggy versions and disable use of splice for these. As of Go 1.18 the minumum Linux version is 2.6.32. Thus, a non-buggy implementation of the splice syscall can be assumed. For #45964 Fixes #54505 Change-Id: Ied3a3334da7a3f7fa1280b7c5b1dfb9030219336 Reviewed-on: https://go-review.googlesource.com/c/go/+/422979 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-12all: replace hand-rolled atomicBool types with atomic.BoolLudi Rehak
Two packages construct atomic booleans from atomic integers. Replace these implementations with the new atomic.Bool type. Indeed, these packages were the impetus for the new atomic.Bool type, having demonstrated a need to access boolean values atomically. Change-Id: I6a0314f8e7d660984a6daf36a62ed05a0eb74b2f Reviewed-on: https://go-review.googlesource.com/c/go/+/411400 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
2022-05-03internal/poll, net, syscall: use accept4 on solarisTobias Klauser
Solaris supports accept4 since version 11.4, see https://docs.oracle.com/cd/E88353_01/html/E37843/accept4-3c.html Use it in internal/poll.accept like on other platforms. Change-Id: I3d9830a85e93bbbed60486247c2f91abc646371f Reviewed-on: https://go-review.googlesource.com/c/go/+/403394 Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Benny Siegert <bsiegert@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-05-02internal/poll: clear completed Buffers to permit earlier collectionBaokun Lee
Updates #45163 Change-Id: I73a6f22715550e0e8b83fbd3ebec72ef019f153f Reviewed-on: https://go-review.googlesource.com/c/go/+/373374 Run-TryBot: Lee Baokun <bk@golangcn.org> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-05all: separate doc comment from //go: directivesRuss Cox
A future change to gofmt will rewrite // Doc comment. //go:foo to // Doc comment. // //go:foo Apply that change preemptively to all comments (not necessarily just doc comments). For #51082. Change-Id: Iffe0285418d1e79d34526af3520b415a12203ca9 Reviewed-on: https://go-review.googlesource.com/c/go/+/384260 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-29all: use new "unix" build tag where appropriateIan Lance Taylor
For #20322 For #51572 Change-Id: Id0b4799d097d01128e98ba4cc0092298357bca45 Reviewed-on: https://go-review.googlesource.com/c/go/+/389935 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2021-12-13all: gofmt -w -r 'interface{} -> any' srcRuss Cox
And then revert the bootstrap cmd directories and certain testdata. And adjust tests as needed. Not reverting the changes in std that are bootstrapped, because some of those changes would appear in API docs, and we want to use any consistently. Instead, rewrite 'any' to 'interface{}' in cmd/dist for those directories when preparing the bootstrap copy. A few files changed as a result of running gofmt -w not because of interface{} -> any but because they hadn't been updated for the new //go:build lines. Fixes #49884. Change-Id: Ie8045cba995f65bd79c694ec77a1b3d1fe01bb09 Reviewed-on: https://go-review.googlesource.com/c/go/+/368254 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-11-05internal/poll: fix the wrong function names in commentsAndy Pan
Change-Id: Ib17df2751209129ad6d1c148829625b347b702a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/361514 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Brad Fitzpatrick <bradfitz@golang.org>
2021-11-04internal/poll: re-use RawSockaddrAny buffers across requests on windowsJosh Bleecher Snyder
We were re-allocating a new RawSockaddrAny on every UDP read/write. We can re-use them instead. This reduces the number of allocs for UDP read/write on windows to zero. Co-authored-by: David Crawshaw <crawshaw@golang.org> Change-Id: I2f05c974e2e7b4f67937ae4e1c99583e81d140af Reviewed-on: https://go-review.googlesource.com/c/go/+/361404 Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-04net: pass around pointers to SockaddrInetNJosh Bleecher Snyder
...instead of the structs themselves. Escape analysis can handle this, and it'll avoid a bunch of large struct copies. Change-Id: Ia9c6064ed32a4c26d5a96dae2ed7d7ece6d38704 Reviewed-on: https://go-review.googlesource.com/c/go/+/361264 Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-04net: remove the alloc from ReadMsgUDPAddrPortJosh Bleecher Snyder
name old time/op new time/op delta ReadWriteMsgUDPAddrPort-8 4.95µs ± 5% 4.55µs ± 1% -7.96% (p=0.016 n=5+4) name old alloc/op new alloc/op delta ReadWriteMsgUDPAddrPort-8 32.0B ± 0% 0.0B -100.00% (p=0.008 n=5+5) name old allocs/op new allocs/op delta ReadWriteMsgUDPAddrPort-8 1.00 ± 0% 0.00 -100.00% (p=0.008 n=5+5) Change-Id: Ib968c6f2968926ec9a364dd52063cd0d7c29b10c Reviewed-on: https://go-review.googlesource.com/c/go/+/360862 Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-04net: remove the alloc from WriteMsgUDPAddrPortJosh Bleecher Snyder
name old time/op new time/op delta ReadWriteMsgUDPAddrPort-8 5.12µs ± 8% 4.59µs ± 3% -10.19% (p=0.000 n=10+9) name old alloc/op new alloc/op delta ReadWriteMsgUDPAddrPort-8 64.0B ± 0% 32.0B ± 0% -50.00% (p=0.000 n=10+10) name old allocs/op new allocs/op delta ReadWriteMsgUDPAddrPort-8 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=10+10) Change-Id: Idf540b2f9f8035660305a0ab1cfc3e162569db63 Reviewed-on: https://go-review.googlesource.com/c/go/+/361257 Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-04internal/poll: remove alloc sending IPv6 UDP on WindowsJosh Bleecher Snyder
This was an oversight in CL 331511. Change-Id: Ibc20bf6ea80a8675d43d9691ed551dffab1d9215 Reviewed-on: https://go-review.googlesource.com/c/go/+/361254 Trust: Josh Bleecher Snyder <josharian@gmail.com> Trust: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
2021-11-03syscall: migrate new UDP send/recv API to internal/syscall/unixJosh Bleecher Snyder
CL 331490 and friends added new API to package syscall. This was a mistake that we need to fix before Go 1.18 is released. Change-Id: I697c9a4fa649d564822f585dc163df5ab9e5ae08 Reviewed-on: https://go-review.googlesource.com/c/go/+/361216 Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-11-02syscall,internal/poll: copy arrays by assignment instead of loopingJosh Bleecher Snyder
golang.org/x/sys contains similar code and also needs updating. Change-Id: Id00177397639075d4792eb253829d8042941b70c Reviewed-on: https://go-review.googlesource.com/c/go/+/360602 Trust: Josh Bleecher Snyder <josharian@gmail.com> Trust: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-10-28all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor)Russ Cox
When these packages are released as part of Go 1.18, Go 1.16 will no longer be supported, so we can remove the +build tags in these files. Ran go fix -fix=buildtag std cmd and then reverted the bootstrapDirs as defined in src/cmd/dist/buildtool.go, which need to continue to build with Go 1.4 for now. Also reverted src/vendor and src/cmd/vendor, which will need to be updated in their own repos first. Manual changes in runtime/pprof/mprof_test.go to adjust line numbers. For #41184. Change-Id: Ic0f93f7091295b6abc76ed5cd6e6746e1280861e Reviewed-on: https://go-review.googlesource.com/c/go/+/344955 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-10-27internal/poll: improve the padding calculation inside struct splicePipeAndy Pan
Updates #48968 and CL 358114 Change-Id: Ic68b4c5420c1c32f78b56874b53d717fa9af1f74 Reviewed-on: https://go-review.googlesource.com/c/go/+/358734 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Tobias Klauser <tobias.klauser@gmail.com>
2021-10-25internal/poll: avoid tiny allocator for splicePipeIan Lance Taylor
We want to set a finalizer on splicePipe, so make it large enough to not use the tiny allocator. Otherwise the finalizer will not run until the rest of the tiny allocation can be freed. This only matters on 32-bit systems. Fixes #48968 Change-Id: I8eb3c9f48fdccab7dc79c5b918d4257b6151ee91 Reviewed-on: https://go-review.googlesource.com/c/go/+/358114 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-10-22internal/poll: fix a few function names on commentsAndy Pan
Change-Id: I5b1dfeeb0ae5ac32667633151ef83bcf4654c43f Reviewed-on: https://go-review.googlesource.com/c/go/+/357957 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-10-13internal/poll,net: support poll.Sendfile for darwinKoichi Shiraishi
darwin already supports syscall.Sendfile. Change-Id: Id3db06591ffad0550b4173bacddeb0acfe355f9e Reviewed-on: https://go-review.googlesource.com/c/go/+/355109 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Alexander Rakoczy <alex@golang.org>
2021-09-17internal/poll: inject a hook into the runtime finalizer to count the closed ↵Andy Pan
pipes Fixes #48066 Change-Id: Icd6974dfcc496c054bb096e5d70de6e135984517 Reviewed-on: https://go-review.googlesource.com/c/go/+/349774 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-09-09internal/poll: report open fds when TestSplicePipePool failsIan Lance Taylor
For #48066 Change-Id: I1152a1c15756df35b71b27d3e7025d97da9e70b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/348579 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-08-16net: reduce allocations for UDP send/recv on WindowsJosh Bleecher Snyder
This brings the optimizations added in CLs 331489 and 331490 to Windows. Updates #43451 Change-Id: I75cf520050325d9eb5c2785d6d8677cc864fcac8 Reviewed-on: https://go-review.googlesource.com/c/go/+/331511 Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
2021-08-16net: reduce allocation size in ReadFromUDPJosh Bleecher Snyder
Switch to concrete types. Bring your own object to fill in. Allocate just enough for the IP byte slice. The allocation is now just 4 bytes for IPv4, which puts it in the tiny allocator, which is much faster. name old time/op new time/op delta WriteToReadFromUDP-8 13.7µs ± 1% 13.4µs ± 2% -2.49% (p=0.000 n=10+10) name old alloc/op new alloc/op delta WriteToReadFromUDP-8 32.0B ± 0% 4.0B ± 0% -87.50% (p=0.000 n=10+10) name old allocs/op new allocs/op delta WriteToReadFromUDP-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Windows is temporarily stubbed out. Updates #43451 Change-Id: Ief506f891b401d28715d22dce6ebda037941924e Reviewed-on: https://go-review.googlesource.com/c/go/+/331490 Trust: Josh Bleecher Snyder <josharian@gmail.com> Trust: Damien Neil <dneil@google.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Damien Neil <dneil@google.com>
2021-08-16net: remove allocation from UDPConn.WriteToJosh Bleecher Snyder
Duplicate some code to avoid an interface. name old time/op new time/op delta WriteToReadFromUDP-8 6.38µs ±20% 5.59µs ±10% -12.38% (p=0.001 n=10+9) name old alloc/op new alloc/op delta WriteToReadFromUDP-8 64.0B ± 0% 32.0B ± 0% -50.00% (p=0.000 n=10+10) name old allocs/op new allocs/op delta WriteToReadFromUDP-8 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=10+10) Windows is temporarily stubbed out. Updates #43451 Change-Id: Ied15ff92268c652cf445836e0446025eaeb60cc9 Reviewed-on: https://go-review.googlesource.com/c/go/+/331489 Trust: Josh Bleecher Snyder <josharian@gmail.com> Trust: Damien Neil <dneil@google.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
2021-05-07internal/poll: cast off the last reference of SplicePipe in testAndy Pan
Updates #45059 Change-Id: I9f377abcc7b77136ae6cf4896b968f73c758b559 Reviewed-on: https://go-review.googlesource.com/c/go/+/317510 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
2021-04-20internal/poll, net: fix comments regarding accept and sysSocketTobias Klauser
The implementation of accept was moved from package net to internal/poll in CL 36799. Change-Id: I6e5964e0ee22e9c84bc444860cdd497817451fec Reviewed-on: https://go-review.googlesource.com/c/go/+/311571 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-04-19net: pass MSG_CMSG_CLOEXEC flag in ReadMsgUnixHowJMay
As mentioned in #42765, calling "recvmsg" syscall on Linux should come with "MSG_CMSG_CLOEXEC" flag. For other systems which not supports "MSG_CMSG_CLOEXEC". ReadMsgUnix() would check the header. If the header type is "syscall.SCM_RIGHTS", then ReadMsgUnix() would parse the SocketControlMessage and call each fd with "syscall.CloseOnExec" Fixes #42765 Change-Id: I74347db72b465685d7684bf0f32415d285845ebb GitHub-Last-Rev: ca59e2c9e0e8de1ae590e9b6dc165cb768a574f5 GitHub-Pull-Request: golang/go#42768 Reviewed-on: https://go-review.googlesource.com/c/go/+/272226 Trust: Emmanuel Odeke <emmanuel@orijtech.com> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2021-04-12internal/poll: ensure that newPoolPipe doesn't return a nil pointerIan Lance Taylor
The function could occasionally return a nil pointer as a non-nil interface, confusing the calling code. Fixes #45520 Change-Id: Ifd35613728efa2cee9903177e85d369155074804 Reviewed-on: https://go-review.googlesource.com/c/go/+/309429 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Andy Pan <panjf2000@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>