grpc / grpc-node

gRPC for Node.js
https://grpc.io
Apache License 2.0
4.45k stars 644 forks source link

When response stream includes messages and then an error, final message(s) can be dropped #2764

Open jhump opened 4 months ago

jhump commented 4 months ago

If the server sends back a sequence of response messages (in a server-stream or bidi-stream RPC) followed by an error status, the client can miss the final message in the stream.

The behavior is not consistent, which suggests some sort of race condition between the error being received on the network and the application code being notified of the last message. It behaves as if, when the error is received on the network, it discards any pending messages that haven’t yet been delivered to the application’s “data” event handler.

murgatroid99 commented 4 months ago

In general, we do not guarantee delivery of all messages if the stream ends with a non-OK status.