-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/http2: awaitRequestCancel sometimes panics #19221
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
Comments
I believe this issue is present in Go 1.8 as well (or it's pebkac, which I would love to be the case) |
/cc @tombergan |
Do you have a minimal repro? The error seems impossible at first glance. Can you repro when running with the race detector? |
Are you using a custom |
Sorry for the delay. I will produce a runnable program when I get a chance, probably this weekend. Appreciate you taking the time to take a look! The |
Some more context, to be explicit: the oauth2 package doesn't do much of anything interesting with the context, other than store an The error I get occurs while serving a request; it seems plausible that something having to do with handling the inbound request is racing with the outbound token exchange. |
Any luck reducing this to a repro? Any answer to @tombergan's question above? |
I wrote a small service that connects to Google OpenID here https://github.com/anthonybishopric/go19221 however I can't get the case to repro just yet. I'm going to try to deploy this onto GKE and see if that changes things. |
I'm going to close this for now. File a new bug (referencing this one) if you get another crash and you're using the latest Go and have no races. Bonus points for minimal repro. :) |
Yep, thanks and sorry. Will try to get a better repro case together. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Go 1.7.4 Linux
What operating system and processor architecture are you using (
go env
)?What did you do?
I'm using https://github.com/golang/oauth2 to exchange an authentication token for an access token from Google's OpenID provider. Sometimes, a spawned goroutine in the http/2 library panics in production, causing my entire web application to crash.
A program to reproduce this issue will need to set up a
oauth2.Config
object and then performgoogleOAuthConfig.Exchange(ctx, authenticationCode)
wherectx
is the HTTP request's context andauthenticationCode
is the code received in thecode=
parameter in the callback URL.The panic occurs in the routine spawned at
h2_bundle.go:6811
, insideawaitRequestCancel
. It appears that when theDone()
channel is closed, there is no corresponding error onctx
(line 5587).What did you expect to see?
A valid exchange of the authentication token for an access token.
What did you see instead?
Sometimes, my server crashes outright.
The text was updated successfully, but these errors were encountered: