Skip to content

Commit 70beac2

Browse files
author
nick
committed
Second fix for PYTHON-1044
1 parent 5d94357 commit 70beac2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cassandra/cluster.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3730,6 +3730,7 @@ def _on_timeout(self, _attempts=0):
37303730
key = "Connection defunct by heartbeat"
37313731
errors = {key: "Client request timeout. See Session.execute[_async](timeout)"}
37323732
self._set_final_exception(OperationTimedOut(errors, self._current_host))
3733+
return
37333734

37343735
pool = self.session._pools.get(self._current_host)
37353736
if pool and not pool.is_shutdown:

tests/unit/test_response_future.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def test_heartbeat_defunct_deadlock(self):
156156

157157
# Simulate ResponseFuture timing out
158158
rf._on_timeout()
159-
self.assertRaises(OperationTimedOut, rf.result)
159+
self.assertRaisesRegexp(OperationTimedOut, "Connection defunct by heartbeat", rf.result)
160160

161161
def test_read_timeout_error_message(self):
162162
session = self.make_session()

0 commit comments

Comments
 (0)