-
Notifications
You must be signed in to change notification settings - Fork 4.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
gRpc "context canceled" error closed stream connection between client and server leading to lost data #3039
Comments
Client Side
for { server side
|
This is related to this issue - |
@dfawley Can you help here ? |
You can't know whether the server has processed the data sent by the client until the client observes a successful stream end. I.e. For long-lived streams, you could build ACKs into your protocol, but this is not something supported by grpc itself. Hope that helps. |
Hi dfawley, |
When the server's' method handler returns, the RPC ends and any client If the connection between the client and server is lost, the transport should eventually fail all its streams, or the deadline of the RPC will be reached, and |
There is a way of doing per-operation timeouts if you wish (killing the stream if the timeout is reached). See #1229 (comment) for an example. This is written assuming server-side but you can do something similar on the client side and cancel the stream's context when the per-operation deadline is reached. |
Thanks a lot for the explanation and guidance. This really clarifies some of the doubts I was having , I shall try and come back and comment here if I get stuck any where. |
gRpc stream server gets conext canceled rpc error in streamServerInstance.Recv() function which leads to the stram connection getting dropped between the server and client. Client side I am using streamClientInstance.Send("data") function which is losing data because its is not getting the error back as the stream is closed now. Is this a bug or I am missing somethiong ? This happens if I send a burst of data using the stream connection, happens usually after 1:30 minutes approxymately or roughly in between 40kto 60k data sent through the stream. The context was not created "withcancel" option at client side.
The text was updated successfully, but these errors were encountered: