MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / _set_final_exception

Method _set_final_exception

cassandra/cluster.py:4915–4934  ·  view source on GitHub ↗
(self, response)

Source from the content-addressed store, hash-verified

4913 callback_partial()
4914
4915 def _set_final_exception(self, response):
4916 self._cancel_timer()
4917 if self._metrics is not None:
4918 self._metrics.request_timer.addValue(time.time() - self._start_time)
4919
4920 with self._callback_lock:
4921 self._final_exception = response
4922 # save off current errbacks inside lock for execution outside it --
4923 # prevents case where _final_exception is set, then an errback is
4924 # added and executed on the spot, then executed again as a
4925 # registered errback
4926 to_call = tuple(
4927 partial(fn, response, *args, **kwargs)
4928 for (fn, args, kwargs) in self._errbacks
4929 )
4930 self._event.set()
4931
4932 # apply each callback
4933 for callback_partial in to_call:
4934 callback_partial()
4935
4936 def _handle_retry_decision(self, retry_decision, response, host):
4937

Callers 6

_on_timeoutMethod · 0.95
send_requestMethod · 0.95
_set_resultMethod · 0.95

Calls 2

_cancel_timerMethod · 0.95
timeMethod · 0.45

Tested by

no test coverage detected