madsim-rs / madsim

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

feature: support timeout in tonic requests #155

Closed bsbds closed 1 year ago

bsbds commented 1 year ago

Currently tonic support the grpc-timeout metadata in requests (Ref: https://docs.rs/tonic/latest/tonic/struct.Request.html#method.set_timeout). However, it appears that this option is currently being ignored in the implementation of madsim, which may cause a client to indefinitely wait for the server.

Should we consider implement this in madsim?

wangrunji0408 commented 1 year ago

Indeed. We have supported setting a global timeout for client in #132. But it's not yet implemented for each individual request. I'll add it soon.

wangrunji0408 commented 1 year ago

A new version madsim-tonic v0.2.25 has been published with this feature. Please update and have a try!