Fix context.DeadlineExceeded error comparison in retry.IsTemporary#1488
Merged
jonjohnsonjr merged 1 commit intogoogle:mainfrom Nov 10, 2022
Merged
Fix context.DeadlineExceeded error comparison in retry.IsTemporary#1488jonjohnsonjr merged 1 commit intogoogle:mainfrom
jonjohnsonjr merged 1 commit intogoogle:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1488 +/- ##
=======================================
Coverage 73.19% 73.19%
=======================================
Files 115 115
Lines 8812 8812
=======================================
Hits 6450 6450
Misses 1712 1712
Partials 650 650
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
jonjohnsonjr
approved these changes
Nov 10, 2022
Collaborator
|
Thanks! |
Contributor
Author
|
@jonjohnsonjr Is there a scheduled release coming up? If not, would it be possible to cut a minor or patch release soon to make this fix available? |
Collaborator
|
We should, if only to do a release with #1468 picked up. |
Contributor
Author
|
Thank you 🙇 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using the default retry predicate,
context.DeadlineExceedederrors wrapped in a*url.Errorare misclassified as temporary and retryable due to an error equality comparison that should be anerrors.Is.This bug results in behavior where timeouts cause the client to continue retrying (and therefore sleeping due to the retry backoff) past the client timeout. This script can be used to reproduce the issue. It simulates 5 seconds of latency on every HTTP request and a 10 second client timeout.
Output:
We see that the extra retry backoff sleeps result in a little over 4 seconds of latency past the client timeout (14.2 seconds elapsed).
If we use the code in this PR (via a
replace github.com/google/go-containerregistry v0.12.0 => github.com/ethan-lowman-dd/go-containerregistry v0.11.1-0.20221110014927-92a137e06282directive ingo.mod), this is the output:We now see that elapsed time is very close to the client timeout of 10 seconds.