Repository navigation
fix(middleware): prevent smart retry delay compounding without schedule_source (#716) - #719
Open
Rajan-vish wants to merge 2 commits into
Open
Rajan-vish wants to merge 2 commits into
Rajan-vish wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #719 +/- ##
==========================================
+ Coverage 85.48% 85.67% +0.18%
==========================================
Files 68 68
Lines 2660 2667 +7
==========================================
+ Hits 2274 2285 +11
+ Misses 386 382 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Please run pre-commit. |
Author
|
Done! Ran |
This branch has not been deployed
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.
Closes #716
What
SmartRetryMiddlewaresent a different delay progression depending on whetherschedule_sourcewas configured.Without
schedule_source,on_sendre-kicks the task withwith_labels(delay=delay), overwritinglabels["delay"]with the newly computed delay. On subsequent errors,make_delayread that updated label back as the base delay rather than the initial configured delay.This caused:
use_delay_exponent=Truewithoutschedule_sourceto compound factorially (base * n!) instead of linearly (base * n), quickly hittingmax_delay_exponent.schedule_source.Fix
_get_initial_delay(message)to resolve and preserve the initial base delay in a private_initial_delaylabel on the kicker across retries.make_delay()now computes the delay from_initial_delay(falling back todelayordefault_delay), ensuring consistent retry intervals across both broker andschedule_sourcepaths.tests/middlewares/test_smart_retry.pycovering:schedule_source(base * n).schedule_sourcepath.delaylabel preservation.