-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
v2.26.2 breaks grpc-websocket-proxy #5326
Comments
Huh, that was certainly unintentional. Is it happening for all attempts to use the websocket proxy? I've used it in the past and I don't recall if it requires there to be no body on the message. Could you share how you think this breaks it? I would be keen to keep supporting the proxy. |
I tried using it with both GET and POST methods to no avail. But I think the hangup will come from how the proxy itself handles the request body: https://github.com/tmc/grpc-websocket-proxy/blob/673ab2c3ae75cc01952b84b88590e30e75dcf395/wsproxy/websocket_proxy.go#L186 It opens a pipe to read/write the body for the lifetime of the websocket. |
I can dig deeper tomorrow, but if #5240 was for cleaning up connections, would we be able to just defer that io.Copy? @paskozdilar would that still solve your issues? |
#5240 was related to gRPC connections hanging indefinitely when client sent a body (e.g. "{}") on methods where google.api.http.body annotation (e.g. body: "*") is not defined. I am not sure if deferred io.Copy would help - but there is an integration test. Try adding defer and seeing if it passes. I have since deleted the repository with bug reproduction code, but I'll upload it again until we figure this one out. Interestingly, the issue also happened in the ad-hoc websocket proxy I used for streaming methods. |
I've re-uploaded the bug report repository: https://github.com/paskozdilar/bug-report-grpc-gateway You can find my implementation of websocket proxy here: https://github.com/paskozdilar/bug-report-grpc-gateway/blob/master/ws.go I've managed to reproduce the issue with WebSocket breaking. Interestingly, when you define Maybe |
Indeed, changing I'm worried because I don't know what's going on under the good, why was Here's the PR: #5331 @jnis23 could you provide a minimal reproducible example of the bug you're having, so I can confirm this change fixes it?
|
Thanks for looking into this so quickly! I'll get a repo up today and start testing |
Sorry for the delay here. I got caught up trying to dig into your question of why the I can confirm that |
@jnis23 This commit fixes it: I'll try to fix this too in the PR. |
My best guess so far is that gRPC detects connection close via some equivalent to This is wild speculation, obviously. I'm yet to dive in the gRPC source code and see what's what. |
I realize https://github.com/tmc/grpc-websocket-proxy is not officially supported by this project, but it's mentioned a lot in issues here. Just flagging that the change in #5240 breaks the websocket-proxy, causing requests to hang indefinitely.
The text was updated successfully, but these errors were encountered: