Fix SDK bugs found by e2e retry tests#302
Merged
didiergarcia merged 5 commits intofeat/tapi-retry-phase4-pipeline-integrationfrom Mar 24, 2026
Merged
Fix SDK bugs found by e2e retry tests#302didiergarcia merged 5 commits intofeat/tapi-retry-phase4-pipeline-integrationfrom
didiergarcia merged 5 commits intofeat/tapi-retry-phase4-pipeline-integrationfrom
Conversation
MichaelGHSeg
commented
Mar 20, 2026
| analytics.log("$logTag dropping batch $url: ${decision.reason}") | ||
| val reason = decision.reason | ||
| analytics.log("$logTag dropping batch $url: $reason") | ||
| analytics.reportInternalError( |
Contributor
Author
There was a problem hiding this comment.
This will trigger the error handler callback when errors result in data being dropped.
MichaelGHSeg
commented
Mar 20, 2026
…tion EventPipeline fixes: - Smart retry override: use RetryStateMachine.shouldDeleteBatch() instead of legacy handleUploadException for statusCodeOverrides alignment (410/460 now retry, 501/505 now drop) - Case-insensitive Retry-After header lookup (OkHttp/HTTP2 lowercases) - X-Retry-Count only sent on retries, omitted on first attempt - DropBatch decision now reports error via reportInternalError RetryStateMachine: - Add shouldDeleteBatch() public method for EventPipeline cleanup decisions e2e-cli: - Wire errorHandler to detect delivery failures (HTTP errors, dropped batches) - Wire maxRetries from test config to SDK BackoffConfig - Clear delivery errors before each flush cycle - Report failure when retries exhausted or batch dropped Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b5ec8ba to
cca6969
Compare
test to ensure okhttp downcases headers.
MichaelGHSeg
commented
Mar 20, 2026
Comment on lines
+251
to
+257
| // Normalize status code: default to 500 for non-HTTP errors | ||
| val effectiveStatusCode = if (statusCode > 0) statusCode else 500 | ||
|
|
||
| // In smart retry mode, override legacy cleanup with state machine decision. | ||
| if (httpConfig != null && effectiveStatusCode !in 200..299) { | ||
| shouldCleanup = retryStateMachine.shouldDeleteBatch(effectiveStatusCode) | ||
| } |
Contributor
Author
There was a problem hiding this comment.
So does this logic pass muster?
Move shouldDeleteBatch decision into handleUploadException instead of overriding cleanup after the fact with effectiveStatusCode. This avoids the httpConfig!=null gate (which doesn't respect enabled flags) and the null-stream edge case (statusCode=0 defaulting to 500 causing retries instead of cleanup). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
didiergarcia
approved these changes
Mar 24, 2026
ec8132f
into
feat/tapi-retry-phase4-pipeline-integration
4 checks passed
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.
Summary
Fixes found while running e2e retry test suite against the smart retry pipeline:
EventPipeline fixes:
RetryStateMachine.shouldDeleteBatch()replaces legacyhandleUploadExceptionfor cleanup decisions — aligns withstatusCodeOverrides(410/460 now retry, 501/505 now drop)reportInternalErrorso errorHandler can detect dropped batchesRetryStateMachine:
shouldDeleteBatch()public method for EventPipeline cleanup decisionse2e-cli:
errorHandlerto detect delivery failures (HTTP errors, dropped batches)maxRetriesfrom test config to SDKBackoffConfigTest plan
🤖 Generated with Claude Code