-
Notifications
You must be signed in to change notification settings - Fork 18k
golang.org/x/net/http2/h2c: GCP Cloud Run Sporadic 502 Bad Gateway #73343
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 think this needs to be a bug report with GCP, the error indicates its a problem with their load balancers, there isn't much the go h2c package can do about "being more robust". |
I opened the issue because other http2 implementations such as Node.js don't have the issue. So to me that means golang's h2c implementation is fragile in a way that Node.js is not. If I file a bug report with GCP and they find out it's working for Node.js and not golang what's to stop GCP maintainers from just pointing the finger back at you? |
GCP issue for reference: https://issuetracker.google.com/issues/410174597 |
Go version
go1.23.6 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I have many Cloud Run applications in GCP that are all golang. I have Cloud Run HTTP2 enabled which means my go servers need
h2c
.Around January of this year, all of my go apps started sporadically producing 502 Bad Gateway responses. This indicates something changed on Google's side. However, through trial and error I've narrowed down at least part of the issue to golang's
h2c
package. I opened a GCP community discussion here but the jist of it is:Here's the go code I deployed to Cloud Run:
Dockerfile:
Command to run from Cloud Build to trigger failure:
About 20% of the time you'll get:
This Node.js implementation, however, never fails:
What did you see happen?
I'm seeing sporadic protocol errors floating out of golang's h2c implementation
What did you expect to see?
I expected golang to be more robust than Node.js! In all seriousness though, I am eager to help investigate/debug further, any tips would be appreciated.
The text was updated successfully, but these errors were encountered: