Defunct connection when internal query fails
Errors that occurred during wait_for_responses(), which is used by the control connection and for preparing statements, were not causing the connection to be closed or defuncted.
This commit is contained in:
@@ -785,7 +785,6 @@ class Cluster(object):
|
||||
self.control_connection.wait_for_schema_agreement(connection)
|
||||
except Exception:
|
||||
log.debug("Error waiting for schema agreement before preparing statements against host %s", host, exc_info=True)
|
||||
# TODO: potentially error out the connection?
|
||||
|
||||
statements = self._prepared_statements.values()
|
||||
for keyspace, ks_statements in groupby(statements, lambda s: s.keyspace):
|
||||
|
||||
@@ -370,7 +370,13 @@ class AsyncoreConnection(Connection, asyncore.dispatcher):
|
||||
raise OperationTimedOut()
|
||||
time.sleep(0.01)
|
||||
|
||||
return waiter.deliver(timeout)
|
||||
try:
|
||||
return waiter.deliver(timeout)
|
||||
except OperationTimedOut:
|
||||
raise
|
||||
except Exception, exc:
|
||||
self.defunct(exc)
|
||||
raise
|
||||
|
||||
def register_watcher(self, event_type, callback):
|
||||
self._push_watchers[event_type].add(callback)
|
||||
|
||||
@@ -418,7 +418,13 @@ class LibevConnection(Connection):
|
||||
raise OperationTimedOut()
|
||||
time.sleep(0.01)
|
||||
|
||||
return waiter.deliver(timeout)
|
||||
try:
|
||||
return waiter.deliver(timeout)
|
||||
except OperationTimedOut:
|
||||
raise
|
||||
except Exception, exc:
|
||||
self.defunct(exc)
|
||||
raise
|
||||
|
||||
def register_watcher(self, event_type, callback):
|
||||
self._push_watchers[event_type].add(callback)
|
||||
|
||||
Reference in New Issue
Block a user