Skip to content

Drop retryable batches without Retry-After when backoff is disabled - #455

Merged
didiergarcia merged 1 commit into
mainfrom
fix/drop-retryable-without-retry-after
Oct 22, 2026
Merged

didiergarcia merged 1 commit into
mainfrom
fix/drop-retryable-without-retry-after

Conversation

@didiergarcia

Copy link
Copy Markdown
Contributor

Fixes the e2e-tests failure on main since July: settings-enabled-flag > backoffConfig.enabled: false > disables backoff retry when enabled is false expects one upload and gets two.

#440 changed shouldDropBatch to keep every retryable batch whenever rate limiting is enabled, on the assumption that the response carried a Retry-After. The caller never passes the headers, so the check never happens. When settings only disable backoff, rate limiting stays enabled, so a 500 without Retry-After is kept and resent. handleResponse already checks for the header, so the two disagreed.

  • RetryStateMachine.shouldDropBatch takes retryAfterSeconds (defaulted) and matches handleResponse: 429 is kept when rate limiting is on; another retryable code is kept for a Retry-After pause when rate limiting is on, otherwise only when backoff is on.
  • HTTPClient makes the drop decision where it has the headers and completes with .badRequest for a dropped batch. SegmentDestination already drops on that for disk batches; the memory path now does too, and .statusCode means the batch will be retried.

Behavior change: a 429 overridden to drop in statusCodeOverrides is now kept while rate limiting is enabled, matching handleResponse, which rate-limits it.

Verified:

  • New unit and flush tests (disk and memory) fail against main (the disk flush makes 2 uploads, as in the e2e run) and pass with the fix.
  • sdk-e2e-tests main run locally against this branch: 90 passed, 3 skipped, 0 failed.
  • Full suites pass locally on macOS (234), iOS (250), tvOS (246) and watchOS (229).

shouldDropBatch kept every retryable batch whenever rate limiting was
enabled, assuming a Retry-After the caller never checked. With backoff
disabled, a 500 batch stayed in storage and was resent. HTTPClient now
makes the drop decision with the response headers.
@didiergarcia
didiergarcia merged commit 4fdb4a4 into main Oct 22, 2026
25 of 26 checks passed
@didiergarcia
didiergarcia deleted the fix/drop-retryable-without-retry-after branch October 22, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants