(self, retry_decision, response, host)
| 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: |
no test coverage detected