Skip to content

Commit cdeb396

Browse files
avelanariusfruch
authored andcommitted
pool: inline signal_connection_failure code
In return_connection() inline the implementation of signal_connection_failure method. After the change, the code works exactly the same as before. This change is required for a followup commit.
1 parent e4c5084 commit cdeb396

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cassandra/pool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,9 @@ def return_connection(self, connection, stream_was_orphaned=False):
542542
if not connection.signaled_error:
543543
log.debug("Defunct or closed connection (%s) returned to pool, potentially "
544544
"marking host %s as down", id(connection), self.host)
545-
is_down = self._session.cluster.signal_connection_failure(
546-
self.host, connection.last_error, is_host_addition=False)
545+
is_down = self.host.signal_connection_failure(connection.last_error)
546+
if is_down:
547+
self._session.cluster.on_down(self.host, False, False)
547548
connection.signaled_error = True
548549

549550
if self.shutdown_on_error and not is_down:

0 commit comments

Comments
 (0)