Repository navigation
fix: do not treat non-retryable DiskRetryer responses as success - #2529
Merged
Merged
Conversation
raise_for_retryable_status only raises for 408/429/5xx. Other error statuses (e.g. 401) previously fell into the success branch and silently deleted the on-disk payload. Treat response.ok as delivery, and for terminal refusals log an error then drop the payload instead of retrying forever. Fixes #2443.
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
alexmojaki
enabled auto-merge (squash)
October 8, 2026 18:15
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
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 #2443: when
DiskRetryerreceives a non-retryable HTTP status (e.g. 401), it previously fell through the success path and silently deleted the queued export.raise_for_retryable_statusonly raises for 408/429/5xx. Any other error status was treated as success, so a permanent refusal (auth failure, forbidden, etc.) dropped the on-disk payload with no log.Fix
In
DiskRetryer._run, after the retryable-status check:response.okas successful delivery (unchanged behavior for 2xx).total_size, and move on — do not retry forever atMAX_DELAY.Tests
Added in
tests/exporters/test_otlp_session.py:test_disk_retryer_drops_non_retryable_http_error— 401 is posted once, payload is dropped, ERROR log is emitted.test_disk_retryer_still_retries_server_errors— 503 keeps retrying until a 200 success.Local:
uv run pytest tests/exporters/test_otlp_session.py— 17 passed.