mirror of
https://github.com/golang/go
synced 2024-11-23 00:10:07 -07:00
runtime: ignore ETIMEDOUT for kevent conservatively
Fixes #59679 Change-Id: I1334b793825a2a57d239e3c98373bf4c93cc622a Reviewed-on: https://go-review.googlesource.com/c/go/+/522215 Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Michael Pratt <mpratt@google.com> Run-TryBot: Andy Pan <panjf2000@gmail.com> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
bc2124dab1
commit
1f3f851a6e
@ -27,10 +27,11 @@ package runtime
|
||||
import "C"
|
||||
|
||||
const (
|
||||
EINTR = C.EINTR
|
||||
EFAULT = C.EFAULT
|
||||
EBUSY = C.EBUSY
|
||||
EAGAIN = C.EAGAIN
|
||||
EINTR = C.EINTR
|
||||
EFAULT = C.EFAULT
|
||||
EBUSY = C.EBUSY
|
||||
EAGAIN = C.EAGAIN
|
||||
ETIMEDOUT = C.ETIMEDOUT
|
||||
|
||||
O_WRONLY = C.O_WRONLY
|
||||
O_NONBLOCK = C.O_NONBLOCK
|
||||
|
@ -6,10 +6,11 @@ package runtime
|
||||
import "unsafe"
|
||||
|
||||
const (
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EBUSY = 0x10
|
||||
_EAGAIN = 0x23
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EBUSY = 0x10
|
||||
_EAGAIN = 0x23
|
||||
_ETIMEDOUT = 0x3c
|
||||
|
||||
_O_WRONLY = 0x1
|
||||
_O_NONBLOCK = 0x4
|
||||
|
@ -31,9 +31,10 @@ package runtime
|
||||
import "C"
|
||||
|
||||
const (
|
||||
EINTR = C.EINTR
|
||||
EFAULT = C.EFAULT
|
||||
EAGAIN = C.EAGAIN
|
||||
EINTR = C.EINTR
|
||||
EFAULT = C.EFAULT
|
||||
EAGAIN = C.EAGAIN
|
||||
ETIMEDOUT = C.ETIMEDOUT
|
||||
|
||||
O_NONBLOCK = C.O_NONBLOCK
|
||||
O_CLOEXEC = C.O_CLOEXEC
|
||||
|
@ -6,9 +6,10 @@ package runtime
|
||||
import "unsafe"
|
||||
|
||||
const (
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_ETIMEDOUT = 0x3c
|
||||
|
||||
_O_WRONLY = 0x1
|
||||
_O_NONBLOCK = 0x4
|
||||
|
@ -6,9 +6,10 @@ package runtime
|
||||
import "unsafe"
|
||||
|
||||
const (
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_ETIMEDOUT = 0x3c
|
||||
|
||||
_O_WRONLY = 0x1
|
||||
_O_NONBLOCK = 0x4
|
||||
|
@ -6,9 +6,10 @@ package runtime
|
||||
import "unsafe"
|
||||
|
||||
const (
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_ETIMEDOUT = 0x3c
|
||||
|
||||
_O_WRONLY = 0x1
|
||||
_O_NONBLOCK = 0x4
|
||||
|
@ -7,9 +7,10 @@ package runtime
|
||||
import "unsafe"
|
||||
|
||||
const (
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_ETIMEDOUT = 0x3c
|
||||
|
||||
_O_WRONLY = 0x1
|
||||
_O_NONBLOCK = 0x4
|
||||
|
@ -13,9 +13,10 @@ package runtime
|
||||
import "unsafe"
|
||||
|
||||
const (
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_ETIMEDOUT = 0x3c
|
||||
|
||||
_O_WRONLY = 0x1
|
||||
_O_NONBLOCK = 0x4
|
||||
|
@ -13,9 +13,10 @@ package runtime
|
||||
import "unsafe"
|
||||
|
||||
const (
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_ETIMEDOUT = 0x3c
|
||||
|
||||
_O_WRONLY = 0x1
|
||||
_O_NONBLOCK = 0x4
|
||||
|
@ -7,9 +7,10 @@ package runtime
|
||||
import "unsafe"
|
||||
|
||||
const (
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EAGAIN = 0x23
|
||||
_ETIMEDOUT = 0x3c
|
||||
|
||||
_O_WRONLY = 0x1
|
||||
_O_NONBLOCK = 0x4
|
||||
|
@ -140,7 +140,10 @@ func netpoll(delay int64) (gList, int32) {
|
||||
retry:
|
||||
n := kevent(kq, nil, 0, &events[0], int32(len(events)), tp)
|
||||
if n < 0 {
|
||||
if n != -_EINTR {
|
||||
// Ignore the ETIMEDOUT error for now, but try to dive deep and
|
||||
// figure out what really happened with n == ETIMEOUT,
|
||||
// see https://go.dev/issue/59679 for details.
|
||||
if n != -_EINTR && n != -_ETIMEDOUT {
|
||||
println("runtime: kevent on fd", kq, "failed with", -n)
|
||||
throw("runtime: netpoll failed")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user