aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/netpoll_solaris.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2015-07-10 15:28:01 -0700
committerIan Lance Taylor <iant@golang.org>2015-09-15 17:56:56 +0000
commitb6d115a583c42cb086de408471dc943ff6704cfb (patch)
tree335efd46e0452be4ac1542ad75492ad7757d4e8c /src/runtime/netpoll_solaris.go
parent731bdc51157fd7f685fb73c298e97922318ac453 (diff)
downloadgo-b6d115a583c42cb086de408471dc943ff6704cfb.tar.gz
go-b6d115a583c42cb086de408471dc943ff6704cfb.zip
runtime: on unexpected netpoll error, throw instead of looping
The current code prints an error message and then tries to carry on. This is not helpful for Go users: they see a message that means nothing and that they can do nothing about. In the only known case of this message, in issue 11498, the best guess is that the netpoll code went into an infinite loop. Instead of doing that, crash the program. Fixes #11498. Change-Id: Idda3456c5b708f0df6a6b56c5bb4e796bbc39d7c Reviewed-on: https://go-review.googlesource.com/12047 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Diffstat (limited to 'src/runtime/netpoll_solaris.go')
-rw-r--r--src/runtime/netpoll_solaris.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/runtime/netpoll_solaris.go b/src/runtime/netpoll_solaris.go
index e4652d8ebd..86e9b997ef 100644
--- a/src/runtime/netpoll_solaris.go
+++ b/src/runtime/netpoll_solaris.go
@@ -174,9 +174,6 @@ func netpollarm(pd *pollDesc, mode int) {
unlock(&pd.lock)
}
-// netpolllasterr holds the last error code returned by port_getn to prevent log spamming
-var netpolllasterr int32
-
// polls for ready network connections
// returns list of goroutines that become runnable
func netpoll(block bool) *g {
@@ -194,9 +191,9 @@ func netpoll(block bool) *g {
retry:
var n uint32 = 1
if port_getn(portfd, &events[0], uint32(len(events)), &n, wait) < 0 {
- if e := errno(); e != _EINTR && e != netpolllasterr {
- netpolllasterr = e
+ if e := errno(); e != _EINTR {
print("runtime: port_getn on fd ", portfd, " failed with ", e, "\n")
+ throw("port_getn failed")
}
goto retry
}