-
Notifications
You must be signed in to change notification settings - Fork 18k
net: ignore WSAECONNRESET AcceptEx error #6987
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
Labels
Milestone
Comments
net/http snippet func (srv *Server) Serve(l net.Listener) error { defer l.Close() var tempDelay time.Duration // how long to sleep on accept failure for { rw, e := l.Accept() //this is where it happens ... if e != nil { if ne, ok := e.(net.Error); ok && ne.Temporary() { if tempDelay == 0 { tempDelay = 5 * time.Millisecond } else { tempDelay *= 2 } if max := 1 * time.Second; tempDelay > max { tempDelay = max } log.Printf("http: Accept error: %v; retrying in %v", e, tempDelay) time.Sleep(tempDelay) continue } return e } tempDelay = 0 c, err := srv.newConn(rw) if err != nil { continue } go c.serve() } } |
WSAECONNRESET is actually about new connection, not about listening socket. I suspect, it just the way AcceptEx is implemented that it returns that error. I suppose, we should ignore it. Alex Labels changed: added release-go1.3, repo-main, os-windows. Owner changed to @alexbrainman. Status changed to Accepted. |
This is related to issue #6163, which is about Accept not ignoring all temporary errors on Linux. |
Please review https://golang.org/cl/49490043/ Alex Status changed to Started. |
This issue was closed by revision c7ef348. Status changed to Fixed. |
rsc
added a commit
that referenced
this issue
May 11, 2015
««« CL 49490043 / 7ecbc2b8ec97 net: ignore some errors in windows Accept Fixes #6987 R=golang-codereviews, dvyukov CC=golang-codereviews https://golang.org/cl/49490043 »»» LGTM=r R=golang-codereviews, r CC=golang-dev https://golang.org/cl/69780044
CL https://golang.org/cl/9946 mentions this issue. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by trivital:
The text was updated successfully, but these errors were encountered: