scylladb / python-driver

ScyllaDB Python Driver, originally DataStax Python Driver for Apache Cassandra
https://python-driver.docs.scylladb.com
Apache License 2.0
70 stars 42 forks source link

Make blocking set keyspace query to fail by timeout #362

Open dkropachev opened 1 month ago

dkropachev commented 1 month ago

It is reimplementing stale PR

set_keyspace_blocking is called from places holding a lock, and in case that the connection is closed from the server side, it might hang forever.

using the connect_timeout on it to make sure it won't hang forever.

Closes: https://github.com/scylladb/python-driver/issues/261

Lorak-mmk commented 1 month ago

I'll repeat what I said on previous PR: I think the root cause is that the disconnected connection is not detected and that is what we should fix. If we correctly detect connection disconnect, then it will error out all the requests on this connection, which will fix infinite waiting.