You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using grpc-gateway (1.4.1) with github.com/tmc/grpc-websocket-proxy for using websockets to do bidirectional streaming. I recently updated to 1.8.1 and noticed that my web client was not behaving as expected. Further analysis showed that:
the websocket proxy was reading messages from the browser appropriately and forwarding them to grpc-gateway,
my grpc server was not receiving any messages.
I also saw that this issue has been reported on the websocket-proxy project.
It seems that the communication between the websocket proxy and the grpc server is blocked by ioutil.ReadAll. If I used a modified websocket proxy code that closes the request body after a few messages, the grpc server receives all the messages.
What did you expect to happen instead:
The grpc server should receive each message as the websocket sends it.
What's your theory on why it isn't working:
This does seem to be related to the ioutil.ReadAll on the request Body.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this bug, as discussed this should be fairly easily resolved for the bidi and client streaming case by not using the ReaderUtil method (since we don't need it there anyway).
An IOReaderFactory was being used to wrap request body for client/bidi streaming
requests. This was causing the requests to be fully buffered before being sent
to the grpc server, thereby breaking streaming. This commit changes that to
directly use request body.
Fixes#894
adasari
pushed a commit
to adasari/grpc-gateway
that referenced
this issue
Apr 9, 2020
An IOReaderFactory was being used to wrap request body for client/bidi streaming
requests. This was causing the requests to be fully buffered before being sent
to the grpc server, thereby breaking streaming. This commit changes that to
directly use request body.
Fixesgrpc-ecosystem#894
Steps you follow to reproduce the error:
I was using grpc-gateway (1.4.1) with github.com/tmc/grpc-websocket-proxy for using websockets to do bidirectional streaming. I recently updated to 1.8.1 and noticed that my web client was not behaving as expected. Further analysis showed that:
I also saw that this issue has been reported on the websocket-proxy project.
It seems that the communication between the websocket proxy and the grpc server is blocked by ioutil.ReadAll. If I used a modified websocket proxy code that closes the request body after a few messages, the grpc server receives all the messages.
What did you expect to happen instead:
The grpc server should receive each message as the websocket sends it.
What's your theory on why it isn't working:
This does seem to be related to the ioutil.ReadAll on the request Body.
The text was updated successfully, but these errors were encountered: