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

Method _handle_retry_decision

cassandra/cluster.py:4936–4956  ·  view source on GitHub ↗
(self, retry_decision, response, host)

Source from the content-addressed store, hash-verified

4934 callback_partial()
4935
4936 def _handle_retry_decision(self, retry_decision, response, host):
4937
4938 def exception_from_response(response):
4939 if hasattr(response, 'to_exception'):
4940 return response.to_exception()
4941 else:
4942 return response
4943
4944 retry_type, consistency = retry_decision
4945 if retry_type in (RetryPolicy.RETRY, RetryPolicy.RETRY_NEXT_HOST):
4946 self._query_retries += 1
4947 reuse = retry_type == RetryPolicy.RETRY
4948 self._retry(reuse, consistency, host)
4949 elif retry_type is RetryPolicy.RETHROW:
4950 self._set_final_exception(exception_from_response(response))
4951 else: # IGNORE
4952 if self._metrics is not None:
4953 self._metrics.on_ignore()
4954 self._set_final_result(None)
4955
4956 self._errors[host] = exception_from_response(response)
4957
4958 def _retry(self, reuse_connection, consistency_level, host):
4959 if self._final_exception:

Callers 1

_set_resultMethod · 0.95

Calls 4

_retryMethod · 0.95
_set_final_exceptionMethod · 0.95
_set_final_resultMethod · 0.95
on_ignoreMethod · 0.80

Tested by

no test coverage detected