-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: apparent deadlock in TestServerWriteTimeout on plan9-amd64-0intro #57114
Comments
Deadlines should be supported. What is not supported is half closing of TCP connections ( I'm not sure why this issue is happening on the amd64 builder only and not on the 386 and arm builders. I'll investigate. |
Turns out that it does occasionally happen on the |
Found new dashboard test flakes for:
2023-01-20 18:12 plan9-arm go@2507e789 net/http.TestServerWriteTimeout (log)
|
The deadlock occurs when the server hits a write deadline while trying to write the response headers. The client's A workaround is to break the deadlock by inserting
just before the call to Strictly speaking this is not specifically a Plan 9 issue, since the deadlock could occur on any platform given the right timing. I've simulated this on linux by hacking a deadline in the past after the server reads the client's request. That results in the same deadlock. However in the wild this is very unlikely to happen because the many-millisecond timeout used in the test should give plenty of time for the server to invoke the handler and start writing headers. Why are we seeing it on Plan 9? Because it turns out there is a race condition in the Plan 9 implementation of I think I have a fix for the @bcmills should I submit the |
Could you file a separate issue for the cross-platform bug? I don't think that setting a client-side If a write timeout occurs before (or while) writing headers, I would expect the server to close the connection immediately instead of waiting for the client to close it. |
Is that the right thing to do with respect to http2 persistent connections? Or should the client be able to time out and send another request on the same connection? I don't know what the http spec says. |
I'm not sure! That's part of why I think it merits a separate issue for discussion. 😅 |
Sorry, I was mistaken: my simulation wasn't realistic. In http2 deadlines (after the TLS handshake) are set by an explicit |
Change https://go.dev/cl/470215 mentions this issue: |
As of CL 449935, the
plan9-amd64-0intro
builder went from failing something like 25% of the time to failing nearly 100% of the time.The vast majority of the current failures are test timeouts running
net/http
, and they all seem to involve goroutines parked innet/http.(*http2ClientConn).RoundTrip
vianet/http_test.testServerWriteTimeout
.I think this is probably because the plan9 netpoll implementation does not support (or does not fully support?)
SetDeadline
.(attn @golang/plan9; CC @neild)
The text was updated successfully, but these errors were encountered: