New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syscall: treat ENFILE as a temporary error, like EMFILE #35131
Comments
Change https://golang.org/cl/203117 mentions this issue: |
On Windows, there's |
If we're going to change this we should change it in the syscall package, in |
Looks like the check for |
Also |
I've updated the CL to change |
This is fixed on Unix systems, but reopening for Windows. |
Change https://golang.org/cl/208537 mentions this issue: |
@alexbrainman @ianlancetaylor the CL for Windows has now eliminated syscall.ENFILE instead of adding WSAEMFILE & WSAENOBUFS to the .Temporary() set. I think we want the latter, and not the former. Tuning the list of Errno constants for Windows is #32309; a CL for it should consider all the "fake" Errno constants defined in pkg syscall, and decide whether to drop them or set them to a common value. cc @iwdgo |
We shouldn't touch any of the fake |
@ianlancetaylor can you endorse adding the WSA* errors I listed to .Temporary()? I believe that was the point of reopening this, but Constantin doesn't believe me :-) https://emptyhammock.com/blog/wsaemfile.html @alexbrainman this is the rationale for the CL you asked about. |
Yes, I think that is the appropriate change here. |
Ian, there is a misunderstanding in the CL thread. Can you reply there, and drop your -2? |
@alexbrainman can you explain why This reference shows the latter occurs when server is loaded: |
@alexbrainman sorry, the link I mentioned is posted in this thread, including immediately above. Unfortunately it doesn't give the code he used, but that should be simple to recreate if nec. |
@djdv this is the only open issue for temporary WSA errors. The original CL author has ceased working on it. If you'd like to take over that work and include the other WSA error you found, that would be great! |
@networkimprov Specifically, I/someone need(s) to go through the WSA error list and figure out which should be considered "temporary" / what |
I think you'd want empirical evidence that an error isn't a cause to drop the connection (and some probably don't occur in practice), so I don't think you'd need to review the WSA list. Let's just add the two discussed above and the one you found. I think there are only minor scope problems with the posted CL. |
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Linux
What did you do?
One of our servers ran out of file handles (/proc/sys/fs/file-max). This led net.Listener.Accept() to return ENFILE (not EMFILE). Since ENFILE is not considered a temporary error, http.Server.Serve exited it's accept loop and returned ENFILE.
What did you expect to see?
ENFILE should be treated as temporary if returned by accept (and possible others). http.Server should not abort its accept loop when encountering ENFILE.
What did you see instead?
The application which received ENFILE logged the error, and continued running without a working listener / http server. If the application had followed the common
log.Fatalln(http.Serve(...))
it would have crashed.The text was updated successfully, but these errors were encountered: