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
net/http: server.Serve() uses deprecated net.Error.Temporary() #66208
Comments
CC @neild |
This is, I believe, mostly checking for Apparently We could try to modernize the |
I agree. However, this feels like having ones cake and eating it too. If such a fundamental part of Golang as the http.Server continues to use it, either |
However, we should have a non-deprecated replacement for the case of testing for transient |
Perfect, thank you
|
Go version
1.22
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
/usr/local/go/src/net/http/server.go:3260:40: ne.Temporary has been deprecated since Go 1.18 because it shouldn't be used: Temporary errors are not well-defined. Most "temporary" errors are timeouts, and the few exceptions are surprising. Do not use this method. (SA1019)
What did you expect to see?
While trying to investigate the proper way to update some of our codebases that relied on the deprecated net.Error.Temporary() function, I went to net/http.Server.Serve example of what to do best. Unfortunately, the logic here is also using the deprecated Temporary() function. It also is using an up to 1s backoff delay before accepting the next connection. This seems undesirable for performance, or am I misunderstanding what the code is doing here?
The text was updated successfully, but these errors were encountered: