Repository navigation
Conversation
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9486 +/- ##
==========================================
+ Coverage 87.61% 87.65% +0.03%
==========================================
Files 436 436
Lines 30818 30820 +2
==========================================
+ Hits 27001 27014 +13
+ Misses 3816 3805 -11
Partials 1 1
🚀 New features to boost your workflow:
|
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.
Fixes #9485
What was the problem: If the context is canceled while RunF is executing f, and f returns nil, RunF returns without stopping the timer, even though the timer has been reset (the timer remains active).
What was changed: As described in the diff in the issue. Added
defer timer.Stop()and checked the context immediately after f before returning.Tests: Since this package had no tests, I added a new file,
backoff_test.go. In line with the issue's recommendation to cover the entire package with tests, coverage is 100%.Exponential.Backoff: Upper limit, jitter range, and ensuring values do not go negative.
RunF: Stops on error, resets, cancellation before execution, cancellation while waiting, and cancellation while
fis executing (the leak in this case).Verified:
go test -race -cpu 1,4and./scripts/vet.shpass. If I remove the fix, the leak test fails.I haven't touched the copy of this package in the xDS client, since the issue raises it separately.
RELEASE NOTES: n/a