Repository navigation
fix(events): back delivery off from an extended initial delay after a refusal - #425
Open
abelonogov-ld wants to merge 1 commit into
Conversation
RETRY 1.5.6 makes the extended initial delay the base of the backoff once an unexpected failure is seen. Delivery reached the same first wait by raising the attempt count to at least 10 on a 1 s base, which a refusal after ten or more ordinary failures overshot. Bind the extended initial delay to 512 s, start the count at 1 on the first refusal since a reset, and floor the extended delays at the initial delay (RETRY 1.5.4.1). Matches the iOS change. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Makes event delivery's backoff conform to RETRY 1.5.6: once an
unexpectedfailure (a 401, 403 or other non-retryable 4xx) has been seen, the backoff is computed from a separate extended initial delay, until an accepted delivery resets it.Stacked on #408 (tier 3).
Delivery used to reach the same first wait by keeping a 1 second base and raising the attempt count to at least 10 on a refusal (2⁹ s = 512 s). That matches RETRY's waits except for one case: a refusal after ten or more ordinary failures in a row overshot, waiting 1024 s or more rather than 512 s.
DeliveryRetryStatebindsEXTENDED_INITIAL_DELAY_MILLIS= 512 s (about 8.5 minutes, the same first wait as before) in place ofATTEMPTS_AFTER_UNEXPECTED.StreamingRetryStatedoes. Later failures of either kind add 1 and keep the extended base and ceiling until a reset.retryDelaysForTestingtakes the extended initial delay too. Each test passes the first refusal wait it got before, so no test's timing changes.The waits for every sequence the existing tests cover are unchanged: 1, 2, 4… s up to the flush interval for ordinary failures; 512, 1024, 2048, then 3600 s for repeated refusals.
Tested:
:launchdarkly-android-client-sdk:testDebugUnitTest, 1259 tests, 0 failures.Note
Overview
Event delivery backoff after unexpected failures (e.g. 401) no longer fakes the ~8.5 minute first wait by jumping the attempt count to 10.
DeliveryRetryStatenow uses an extended regime: the first refusal since a successful delivery setsinExtendedRegimeand resets attempts to 1, then waits are computed fromEXTENDED_INITIAL_DELAY_MILLIS(512s) with the extended ceiling, matching RETRY 1.5.6 and avoiding overshoot when many ordinary failures precede a refusal.Extended initial/ceiling delays are clamped to at least the normal initial delay (RETRY 1.5.4.1).
ComponentsImpl.retryDelaysForTestingandDeliveryRetryState’s constructor take a configurable extended initial delay; tests pass explicit values so existing timing expectations stay the same, plus new cases for refusal-after-many-ordinary-failures and inverted delay bounds.Reviewed by Cursor Bugbot for commit 95fe680. Bugbot is set up for automated code reviews on this repo. Configure here.