-
Notifications
You must be signed in to change notification settings - Fork 94
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
Allow turning on TCP keepalive for specific sessions/connections #132
Comments
Depends on tokio-rs/tokio#3082 - |
Leaving a comment with similar insight to the one I left under #394: We could implement a keepalive now without waiting for tokio to support TCP-level keepalives if we take a similar approach as Java and Python drivers do, namely send a cheap query every keepalive period, e.g. |
If I want to manually send a cheap query until this is implemented, how can I make sure every connection in the pool is refreshed? For example, I have 3 nodes, the default connection pool size is 4. If sending every |
@elbaro it won't be that easy on Scylla, because our driver is also shard-aware, and we try to send data to a specific shard if possible, and also your queries would have to be hand-crafted to hit proper tokens, so that each connection is used eventually (or make a query that's not token-aware, e.g. an unprepared one, but these ones are more expensive). @havaker is working on an internal solution that allows configuring the keepalive period right now, and the solution will make sure that each connection is kept alive if it's configured. Hopefully we'll be able to give you a branch for testing today/tomorrow. |
I'm reopening this. The #395 implemented CQL-level keepalives which is useful but is not the same as TCP-level keepalives. Some drivers expose both (e.g. cpp driver: https://github.com/scylladb/cpp-driver/blob/eb6b70d138752c5e6a487eeaf69e6baa4d6652a4/include/cassandra.h#L2533-L2536). According to this comment, it is possible to set TCP keepalives on a tokio socket, although with the help of an external crate. |
Context: scylladb/scylladb#7781 (comment)
It can be useful for clients to decide that connections created within a session should/should not be subject to TCP timeouts.
The text was updated successfully, but these errors were encountered: