New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide caller with information on raised exception after retry #926
Comments
Thanks for the feedback. The only thing we'll need to keep in mind is we'll need to do this in a way that's backwards compatible. Otherwise, I think being able to communicate this information somehow would be useful. |
@jamesls I was just thinking about this, could we just add it to the |
@JordonPhillips I think that would work. |
* in botocore.retryhandler.MaxAttemptsDecorator.__call__(), add a MaxAttemptsReached=True element to ResponseMetadata if the maximum number of attempts is reached * in botocore.endpoint.Endpoint._send_request(), add a NumAttempts element to ResponseMetadata, containing the attempt number
@jamesls @JordonPhillips I've got a simple implementation of this as #965 - coverage stayed the same, though it appears that most of The implementation may be a bit naive, so I'm certainly open to changing/reworking it as needed. |
…that it's a tuple, per PR comment
…seMetadata, pass back max_attempts and a list of retry error reasons, per PR comment
* jantman-issue926_retry_info: Update error message when max retries reached Add changelog entry for response metadata change Add retry info to ClientError text Replace list of retries with number of retries fixes #926 - expose retry information in exceptions
* release-1.4.51: Bumping version to 1.4.51 Update to latest models Update error message when max retries reached Add changelog entry for last_response feature Add changelog entry for response metadata change Add retry info to ClientError text Replace list of retries with number of retries fixes #926 - expose retry information in exceptions Add last_response attr to WaiterError Waiter throw ClientError for unexpected error response
As far as I can tell, when retryhandler.MaxAttemptsDecorator reaches its maximum number of attempts, the retryable exception is returned to the caller. I just spent about 3 hours tracing through boto3 and botocore and writing test code to reproduce a RequestLimitExceeded error, only to find that botocore was properly retrying and the only thing I can think of is that the request limit was really exceeded (even after 5 exponential backoff retries).
It would be very useful in cases like this if the retry handler either (a) wrapped the actual exception in a (e.g.) MaxRetriesExceeded exception, to make it clear that the request was retried and perhaps include the number of retries and maybe the sleep duration, or (b) at least fire an event with this information.
While I do really appreciate that the retry logic is so transparent, this also makes it a bit opaque for debugging, as there's really no way I can find to confirm (especially programmatically in the caller) that the request was, in fact, retried and all retries failed.
Thanks,
Jason Antman
(this came up when investigating this issue.)
The text was updated successfully, but these errors were encountered: