diff --git a/cassandra/cluster.py b/cassandra/cluster.py index a9dacff4..9f1ee60c 100644 --- a/cassandra/cluster.py +++ b/cassandra/cluster.py @@ -2810,6 +2810,7 @@ class ResponseFuture(object): """ Internal """ # query_plan is an iterator, so this will resume where we last left # off if send_request() is called multiple times + start = time.time() for host in self.query_plan: req_id = self._query(host) if req_id is not None: @@ -2821,6 +2822,9 @@ class ResponseFuture(object): if self._timer is None: self._start_timer() return + if self.timeout is not None and time.time() - start > self.timeout: + self._on_timeout() + return self._set_final_exception(NoHostAvailable( "Unable to complete the operation against any hosts", self._errors))