fix: broken websocket connection after upgrading github.com/grpc-ecosystem/grpc-gateway/v2#4270
Conversation
Maybe silly question - but the watch gameserver websocket connection continues to work, no? (because the test checks this). I thought this was just getting the GameServer through a websocket? Or maybe I misunderstood? |
|
/gcbrun |
|
Build Failed 😭 Build Id: 5b59fa3d-211b-4fad-aa67-dcc22a2edfd3 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
Great question! I think I failed describing the issue properly. The websocket connection is only used to listen on changes that happens on the gameserver CRD. The fix is to send an empty body. Firstly because we use a The
The last point never executes because the connection never established, but hangs instead. |
|
Also, I don’t get why the gcburn failed 🤔 |
cb6a724 to
aaaa05b
Compare
|
Honestly though, the fix stared me right in the face. We don't need to fake the body, we just need to pass the request body to the proxy and that will work with both post/get calls |
|
Looks like e2e tests are being extra flaky again. |
07b11ee to
c3637dd
Compare
c3637dd to
95b3b13
Compare
|
/gcbrun |
|
Build Succeeded 🥳 Build Id: 5731ec03-31bc-481e-9a4e-4a511817ccbf The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
|
/gcbrun |
|
Build Failed 😭 Build Id: 3e22d54c-b6ca-4b34-a4b8-dba8dd4e0f56 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
Flake: Blarg, this keeps failing on Autopilot for some reason. I do wonder why. |
|
Quick gut check before I approve this for merge - One issue with having this fix in the vendor directory is that any run of Does it make sense for someone (@swermin ?) to maintain a fork of github.com/tmc/grpc-websocket-proxy with the fix in it, and we change our go.mod to point at the fork (probably with a |
|
I didn’t think of that, that a |
I did add a comment on the code, the part that needed a fix. Or do you mean on the other lines? |
Oh indeed my bad, looks all good, or maybe in the go.mod if it uses a fork or something, otherwise all good |
|
Build Succeeded 🥳 Build Id: a56e6483-9ac1-4511-a221-b63ad616894f The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
|
I've updated to use a forked version of the module and used |
|
/gcbrun |
|
Woho! 🙌 |
|
Very nice work! Lemme know if I can do anything to help you be more active here 😃 |
|
Build Succeeded 🥳 Build Id: 30fcdeb1-2716-452e-9592-fefda0e7cfb8 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
Oh I’m constantly lurking in here, but I will try to be more engaging going forward! 😄 |
|
@swermin I went hunting for you in Slack 😄 could't find you. |
|
I just messaged you on slack! 🙌 |
…ystem/grpc-gateway/v2 (agones-dev#4270) * fix broken websocket connection after upgrading github.com/grpc-ecosystem/grpc-gateway/v2 * add comment explaining the issue at hand * use the request body instead of an empty one * make sure conformance tests errors are captured * use go mod replacement for websocket hotfix --------- Co-authored-by: Thomas Lacroix <thomas.lacroix@ubisoft.com>
…ystem/grpc-gateway/v2 (agones-dev#4270) * fix broken websocket connection after upgrading github.com/grpc-ecosystem/grpc-gateway/v2 * add comment explaining the issue at hand * use the request body instead of an empty one * make sure conformance tests errors are captured * use go mod replacement for websocket hotfix --------- Co-authored-by: Thomas Lacroix <thomas.lacroix@ubisoft.com>
…ystem/grpc-gateway/v2 (agones-dev#4270) * fix broken websocket connection after upgrading github.com/grpc-ecosystem/grpc-gateway/v2 * add comment explaining the issue at hand * use the request body instead of an empty one * make sure conformance tests errors are captured * use go mod replacement for websocket hotfix --------- Co-authored-by: Thomas Lacroix <thomas.lacroix@ubisoft.com>
…ystem/grpc-gateway/v2 (agones-dev#4270) * fix broken websocket connection after upgrading github.com/grpc-ecosystem/grpc-gateway/v2 * add comment explaining the issue at hand * use the request body instead of an empty one * make sure conformance tests errors are captured * use go mod replacement for websocket hotfix --------- Co-authored-by: Thomas Lacroix <thomas.lacroix@ubisoft.com>
* patch-releasev1.52.1 * fix: broken websocket connection after upgrading github.com/grpc-ecosystem/grpc-gateway/v2 (#4270) * fix broken websocket connection after upgrading github.com/grpc-ecosystem/grpc-gateway/v2 * add comment explaining the issue at hand * use the request body instead of an empty one * make sure conformance tests errors are captured * use go mod replacement for websocket hotfix --------- Co-authored-by: Thomas Lacroix <thomas.lacroix@ubisoft.com> * update few changes * update some dependencies files * update config.toml files --------- Co-authored-by: Ermin Hrkalovic <ermin.hrkalovic@guerrilla-games.com> Co-authored-by: Thomas Lacroix <thomas.lacroix@ubisoft.com>
…ystem/grpc-gateway/v2 (agones-dev#4270) * fix broken websocket connection after upgrading github.com/grpc-ecosystem/grpc-gateway/v2 * add comment explaining the issue at hand * use the request body instead of an empty one * make sure conformance tests errors are captured * use go mod replacement for websocket hotfix --------- Co-authored-by: Thomas Lacroix <thomas.lacroix@ubisoft.com>

What type of PR is this?
/kind bug
What this PR does / Why we need it:
This PR introduces a change to the
tmc/grpc-websocket-proxyto fix a deadlock when trying to establish a websocket connection to gRPC code that was generated bygithub.com/grpc-ecosystem/grpc-gateway/v2on version 2.26.2 and above.github.com/grpc-ecosystem/grpc-gateway/v2on version 2.26.2 introduced this change PR 5240 that causes request that has empty body specified to drain the body before proceeding with the call. This change was introduced back in April 2025 and the maintainer of thetmc/grpc-websocket-proxyhas not been active for a while, making this breaking bug lingering and blocks projects that has websocket support as a requirement to be able to upgrade to newer agones versions.As a workaround, due to critical functionality is broken, this PR introduces a fix in the vendor folder, so that we can unblock agones upgrades for projects that are depending on the websocket connection to work.
Which issue(s) this PR fixes:
Closes #4248
Special notes for your reviewer:
This is just a fix for the watch gameserver websocket connection, as it only ever sends data from the sidecar to the gameserver executable. That is fine for this current setup. If we need bi-directional support whatsoever from the websocket connection then this change will not work as there is no functionality exposed to send data through the proxy.