aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/netpoll_aix.go
diff options
context:
space:
mode:
authorMikio Hara <mikioh.public.networking@gmail.com>2019-03-10 14:30:06 +0900
committerMikio Hara <mikioh.public.networking@gmail.com>2019-03-13 08:53:02 +0000
commita5fdd58c84b6b0a1ae5a53faebc0550024e3a066 (patch)
tree5d554f98211577c24c39a6506352da7e80f39125 /src/runtime/netpoll_aix.go
parenta891f2e2ae60c1cc740751bcb3427f71c618b9d0 (diff)
downloadgo-a5fdd58c84b6b0a1ae5a53faebc0550024e3a066.tar.gz
go-a5fdd58c84b6b0a1ae5a53faebc0550024e3a066.zip
runtime, internal/poll, net: report event scanning error on read event
This change makes it possible the runtime-integrated network poller and APIs in the package internal/poll to report an event scanning error on a read event. The latest Go releases open up the way of the manipulation of the poller for users. On the other hand, it starts misleading users into believing that the poller accepts any user-configured file or socket perfectly because of not reporting any error on event scanning, as mentioned in issue 30426. The initial implementation of the poller was designed for just well-configured, validated sockets produced by the package net. However, the assumption is now obsolete. Fixes #30624. Benchmark results on linux/amd64: benchmark old ns/op new ns/op delta BenchmarkTCP4OneShot-4 24649 23979 -2.72% BenchmarkTCP4OneShotTimeout-4 25742 24411 -5.17% BenchmarkTCP4Persistent-4 5139 5222 +1.62% BenchmarkTCP4PersistentTimeout-4 4919 4892 -0.55% BenchmarkTCP6OneShot-4 21182 20767 -1.96% BenchmarkTCP6OneShotTimeout-4 23364 22305 -4.53% BenchmarkTCP6Persistent-4 4351 4366 +0.34% BenchmarkTCP6PersistentTimeout-4 4227 4255 +0.66% BenchmarkTCP4ConcurrentReadWrite-4 2309 1839 -20.36% BenchmarkTCP6ConcurrentReadWrite-4 2180 1791 -17.84% benchmark old allocs new allocs delta BenchmarkTCP4OneShot-4 26 26 +0.00% BenchmarkTCP4OneShotTimeout-4 26 26 +0.00% BenchmarkTCP4Persistent-4 0 0 +0.00% BenchmarkTCP4PersistentTimeout-4 0 0 +0.00% BenchmarkTCP6OneShot-4 26 26 +0.00% BenchmarkTCP6OneShotTimeout-4 26 26 +0.00% BenchmarkTCP6Persistent-4 0 0 +0.00% BenchmarkTCP6PersistentTimeout-4 0 0 +0.00% BenchmarkTCP4ConcurrentReadWrite-4 0 0 +0.00% BenchmarkTCP6ConcurrentReadWrite-4 0 0 +0.00% benchmark old bytes new bytes delta BenchmarkTCP4OneShot-4 2000 2000 +0.00% BenchmarkTCP4OneShotTimeout-4 2000 2000 +0.00% BenchmarkTCP4Persistent-4 0 0 +0.00% BenchmarkTCP4PersistentTimeout-4 0 0 +0.00% BenchmarkTCP6OneShot-4 2144 2144 +0.00% BenchmarkTCP6OneShotTimeout-4 2144 2145 +0.05% BenchmarkTCP6Persistent-4 0 0 +0.00% BenchmarkTCP6PersistentTimeout-4 0 0 +0.00% BenchmarkTCP4ConcurrentReadWrite-4 0 0 +0.00% BenchmarkTCP6ConcurrentReadWrite-4 0 0 +0.00% Change-Id: Iab60e504dff5639e688dc5420d852f336508c0af Reviewed-on: https://go-review.googlesource.com/c/go/+/166497 Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/netpoll_aix.go')
-rw-r--r--src/runtime/netpoll_aix.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/netpoll_aix.go b/src/runtime/netpoll_aix.go
index 1e886dae94..b4d7de8c2a 100644
--- a/src/runtime/netpoll_aix.go
+++ b/src/runtime/netpoll_aix.go
@@ -232,6 +232,10 @@ retry:
if pollVerbose {
println("*** netpollready i=", i, "revents=", pfd.revents, "events=", pfd.events, "pd=", pds[i])
}
+ pds[i].everr = false
+ if pfd.revents&_POLLERR != 0 {
+ pds[i].everr = true
+ }
netpollready(&toRun, pds[i], mode)
n--
}