Skip to content

Commit d62eb38

Browse files
authored
Merge pull request #398 from tchaikov/shard-unware-conn
pool: Handle non-shard-aware endpoints in logging
2 parents 1316cd1 + 2fcce70 commit d62eb38

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cassandra/pool.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,11 @@ def _open_connection_to_missing_shard(self, shard_id):
731731
else:
732732
conn = self._session.cluster.connection_factory(self.host.endpoint, host_conn=self, on_orphaned_stream_released=self.on_orphaned_stream_released)
733733

734-
log.debug("Received a connection %s for shard_id=%i on host %s", id(conn), conn.features.shard_id, self.host)
734+
log.debug(
735+
"Received a connection %s for shard_id=%i on host %s",
736+
id(conn),
737+
conn.features.shard_id if conn.features.shard_id is not None else -1,
738+
self.host)
735739
if self.is_shutdown:
736740
log.debug("Pool for host %s is in shutdown, closing the new connection (%s)", self.host, id(conn))
737741
conn.close()

0 commit comments

Comments
 (0)