-
Notifications
You must be signed in to change notification settings - Fork 108
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
Implement client-side timeouts #304
Comments
It is possible to cancel requests right now, without the driver's explicit support for timeouts. You can just stop waiting for the future returned by e.g. tokio::time::timeout(Duration::from_secs(10), session.execute(statement)); In the meantime, the stream ID won't be removed until the response arrive from the node. |
Which it never may e.g. due to shedding, so we can leak stream IDs and channels (they will keep using memory until the connection is closed). |
Yes. It would be nice to fix this along with the following issue: #305 - we could remove the oneshot channel from the handler map when the corresponding future is removed. The stream ID would still be kept allocated in the stream ID bitmap until the response arrives, or until the connection is closed if the request was shed. |
@wprzytula let's consider the following granularity:
|
In certain cases (e.g. when a node dies) it's important to be able to set a client-side timeout which gives up on a request after specified time - and optionally retries on another connection. While at it, it's very important to remember that
stream_id
s must not be reused right after client-side timeout occurs - otherwise, future requests might receive responses directed to some other request that timed out.The text was updated successfully, but these errors were encountered: