forked from apache/cassandra-python-driver
-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
wait_for_schema_agreement picks connection from control connection without handling control connection reconnection so it is possible to pick closed connection.
python-driver/cassandra/cluster.py
Lines 4073 to 4074 in 7597059
| if not connection: | |
| connection = self._connection |
It can be a problem if
wait_for_schema_agreement is used as a public API e.g. in scylladb's tests:https://github.com/scylladb/scylla-dtest/blob/d4b534021036503fdcc3400ab5da9f3407c81cf3/dtest_class.py#L220
There is an optional connection argument in wait_for_schema_agreement, it is currently used only in case when we received RESULT_KIND_SCHEMA_CHANGE to ensure wait_for_schema_agreement is ran on the same host where the statement was executed.
Maybe instead of connection we can hand over a connectionpool or session to ensure correctness even if one particular connection is closed for some reason.
Refs: scylladb/scylladb#25966
Metadata
Metadata
Assignees
Labels
No labels