madsim-rs / madsim

Magical Deterministic Simulator for distributed systems in Rust.
Apache License 2.0
618 stars 41 forks source link

fix(tonic): allows the server to prematurely close the stream in client side streaming #218

Closed bsbds closed 2 weeks ago

bsbds commented 3 weeks ago

The client uses Grpc::client_streaming to send a stream to the server. However, in the current implementation, if the server closes the stream prematurely, the madsim channel will be closed and will return a "connection reset" error to the client. Thus, the client will never receive the response from the server. We should allow the server to close the stream before sending back the response.