Skip to content

Commit

Permalink
Merge pull request #398 from tchaikov/shard-unware-conn
Browse files Browse the repository at this point in the history
pool: Handle non-shard-aware endpoints in logging
  • Loading branch information
dkropachev authored Jan 3, 2025
2 parents 1316cd1 + 2fcce70 commit d62eb38
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cassandra/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,11 @@ def _open_connection_to_missing_shard(self, shard_id):
else:
conn = self._session.cluster.connection_factory(self.host.endpoint, host_conn=self, on_orphaned_stream_released=self.on_orphaned_stream_released)

log.debug("Received a connection %s for shard_id=%i on host %s", id(conn), conn.features.shard_id, self.host)
log.debug(
"Received a connection %s for shard_id=%i on host %s",
id(conn),
conn.features.shard_id if conn.features.shard_id is not None else -1,
self.host)
if self.is_shutdown:
log.debug("Pool for host %s is in shutdown, closing the new connection (%s)", self.host, id(conn))
conn.close()
Expand Down

0 comments on commit d62eb38

Please sign in to comment.