Skip to content

Commit d5265bd

Browse files
committed
Don't check for schema agreement when shutdown
This avoids some unneeded noise in debug logs when shutting down a Cluster.
1 parent 69337d8 commit d5265bd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cassandra/cluster.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,7 @@ class ControlConnection(object):
12011201

12021202
# for testing purposes
12031203
_time = time
1204+
_is_shutdown = False
12041205

12051206
def __init__(self, cluster):
12061207
# use a weak reference to allow the Cluster instance to be GC'ed (and
@@ -1217,8 +1218,6 @@ def __init__(self, cluster):
12171218
self._reconnection_handler = None
12181219
self._reconnection_lock = RLock()
12191220

1220-
self._is_shutdown = False
1221-
12221221
def connect(self):
12231222
if self._is_shutdown:
12241223
return
@@ -1490,6 +1489,9 @@ def wait_for_schema_agreement(self, connection=None):
14901489
# a lock is just a simple way to cut down on the number of schema queries
14911490
# we'll make.
14921491
with self._schema_agreement_lock:
1492+
if self._is_shutdown:
1493+
return
1494+
14931495
log.debug("[control connection] Waiting for schema agreement")
14941496
if not connection:
14951497
connection = self._connection

0 commit comments

Comments
 (0)