Skip to content

Conversation

@dkropachev
Copy link
Collaborator

Summary

When a connection is closed or becomes defunct, include the last_error in the ConnectionShutdown exception message.

Before:

cassandra.connection.ConnectionShutdown: Connection to 10.12.33.86:9042 is defunct

After:

cassandra.connection.ConnectionShutdown: Connection to 10.12.33.86:9042 is defunct: [Errno 9] Bad file descriptor

This helps investigate #614 by preserving the original error reason when subsequent operations try to use a closed connection.

Test plan

  • Added unit tests for send_msg() and wait_for_responses() verifying last_error is included
  • All existing unit tests pass

When a connection is closed or becomes defunct, include the last_error
in the ConnectionShutdown exception message. This helps investigate
issues where the original cause (e.g., "Bad file descriptor") was
previously lost when subsequent operations tried to use the connection.

Refs #614
@dkropachev dkropachev self-assigned this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants