-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: http2 via Forward Proxy block on getClientConn because of deadlock #49377
Comments
1.15 is outside of our support cycle, and given the fixes you've already found which may fix the issue, I don't think there's much to do unless you can provide a reproducer and verify if it works with the fixes above. |
@seankhliao Thanks for your quick comment. Yes, we are still capturing the input traffics which would trigger the output traffics via our http client. Once we can reproduce this issue, we will verify it. It would take some time for us to upgrade from 1.15 to 1.16 or 1.17 on Production, so before this, we still need to investigate why it got stuck on We will update this when we have a reproducer. Thanks. |
Note that you can use a more recent HTTP/2 client without upgrading to a newer Go release with something like this:
This will use the HTTP/2 client implementation in golang.org/x/net/http2 instead of the one vendored into net/http. |
@neild Thanks for your great suggestion. As I can tell from X Repositories and http2 package which says as below, it may not suitable for our Production Services, but I think we will definitely use it for verifying if it could resolve our issue once we have a reproducer. Great thanks again.
|
We had avoided this issue by tuning some parameters on the Application and System level to abort 'abnormal' TCP connections asap, and so far so good. So I'm going to close this issue and please help to remove the label 'WaitingForInfo' if needed. Last but not least, many thanks for all the suggestions. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Haven't try it yet, since we are unable to reproduce this issue now. But it almost happens one time on PRD per day.
And maybe related to this all: update golang.org/x/net to pull in CL 353390 · golang/go@7109323 (github.com) which release since go.1.16.9 and go.1.17.2.
What operating system and processor architecture are you using (
go env
)?Production Server, no go environment.
What did you do?
Send requests using custom http client through a Forward Proxy which is a Squid process running on another instance.
What did you expect to see?
Send requests and receive responses without any problems.
What did you see instead?
A brief summary: our application hang and OOM soon.
We used go pprof and dump goroutines and all goroutines' stacks, and had found where the application hang and finally OOM.
By goroutines graph, we found all goroutines try to acquire http2clientConnPool's mu, pick one of them as an example:
And by digging into the goroutine stacks, we found:
so it's a dead lock now and all other goroutines got stuck in getClientConn, please see code below(all code based on go1.15.3):
goroutineA(172922339) stacks:
goroutineB(172921412) stacks:
blocked within cc.bw.Flush():
So it maybe similar questions about:
And maybe fixed by this commit: all: update golang.org/x/net to pull in CL 353390 · golang/go@7109323 (github.com).
But as I mentioned before, since we could not reproduce it right now, so we are not sure.
And we found all other streams from this conn are trying to writeStreamReset after ctx.Done(), so maybe this conn had broken? Pick one of them:
So is there any suggestions or comments that why cc.bw.Flush() got stuck? And if you need more information, please let me know. Thanks in advanced.
The text was updated successfully, but these errors were encountered: