google / tarpc

An RPC framework for Rust with a focus on ease of use.
MIT License
3.18k stars 194 forks source link

Fix hanging clients on RequestDispatch error #423

Closed tikue closed 8 months ago

tikue commented 8 months ago

Previously, when hitting an error, RequestDispatch would stop immediately without doing any cleanup. The pending requests channel would be close on drop, but any requests that were already in the channel would hang indefinitely.

With this PR, RequestDispatch will do a better cleanup job: it will close and drain the the pending requests, completing each request with the same error that caused the RequestDispatch to halt.

Fixes https://github.com/google/tarpc/issues/415