Skip to content

Commit b470667

Browse files
committed
fix docs, ResponseFuture.attempted_hosts
PYTHON-218
1 parent df93b84 commit b470667

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cassandra/cluster.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3231,10 +3231,12 @@ class ResponseFuture(object):
32313231

32323232
coordinator_host = None
32333233
"""
3234-
The host an actual result from (
3234+
The host from which we recieved a response
32353235
"""
32363236

3237+
attempted_hosts = None
32373238
"""
3239+
A list of hosts tried, including all speculative executions, retries, and pages
32383240
"""
32393241

32403242
session = None
@@ -3287,7 +3289,7 @@ def __init__(self, session, message, query, timeout, metrics=None, prepared_stat
32873289
self._callbacks = []
32883290
self._errbacks = []
32893291
self._spec_execution_plan = speculative_execution_plan or self._spec_execution_plan
3290-
self._queried_hosts = []
3292+
self.attempted_hosts = []
32913293

32923294
def _start_timer(self):
32933295
if self._timer is None:
@@ -3385,6 +3387,7 @@ def _query(self, host, message=None, cb=None):
33853387
encoder=self._protocol_handler.encode_message,
33863388
decoder=self._protocol_handler.decode_message,
33873389
result_metadata=result_meta)
3390+
self.attempted_hosts.append(host)
33883391
return request_id
33893392
except NoConnectionsAvailable as exc:
33903393
log.debug("All connections for host %s are at capacity, moving to the next host", host)
@@ -3640,7 +3643,6 @@ def _execute_after_prepare(self, host, connection, pool, response):
36403643
Handle the response to our attempt to prepare a statement.
36413644
If it succeeded, run the original query again against the same host.
36423645
"""
3643-
"AFTER PREPARE"
36443646
if pool:
36453647
pool.return_connection(connection)
36463648

0 commit comments

Comments
 (0)