mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: treat ENFILE as a temporary error
ENFILE is returned from accept when the whole system has run out of file descriptors. Mark the error as temporary, so that accept loops continue working. Fixes #35131 Updates #1891 Change-Id: Idf44c084731898ff4c720d06c250d3b8a42de312 Reviewed-on: https://go-review.googlesource.com/c/go/+/203117 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
f4e32aeed1
commit
17190de085
2 changed files with 7 additions and 1 deletions
|
|
@ -384,3 +384,9 @@ func TestSetsockoptString(t *testing.T) {
|
|||
t.Fatalf("SetsockoptString: did not fail")
|
||||
}
|
||||
}
|
||||
|
||||
func TestENFILETemporary(t *testing.T) {
|
||||
if !syscall.ENFILE.Temporary() {
|
||||
t.Error("ENFILE is not treated as a temporary error")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue