Skip to content

fix: do not treat non-retryable DiskRetryer responses as success - #2529

Merged
alexmojaki merged 5 commits into
mainfrom
codex/disk-retryer-pr-2467-copy
Oct 8, 2026
Merged

alexmojaki merged 5 commits into
mainfrom
codex/disk-retryer-pr-2467-copy

Conversation

@alexmojaki

Copy link
Copy Markdown
Contributor

Summary

Fixes #2443: when DiskRetryer receives a non-retryable HTTP status (e.g. 401), it previously fell through the success path and silently deleted the queued export.

raise_for_retryable_status only 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:

  • Treat response.ok as successful delivery (unchanged behavior for 2xx).
  • For other non-retryable HTTP errors, log an error with the status and payload size, unlink the file, update total_size, and move on — do not retry forever at MAX_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.

vyrnsynx and others added 5 commits September 24, 2026 08:15
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.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

@alexmojaki
alexmojaki enabled auto-merge (squash) October 8, 2026 18:15
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  logfire-sdk/logfire/_internal/exporters
  otlp.py
Project Total  

This report was generated by python-coverage-comment-action

@alexmojaki
alexmojaki merged commit 650cfd5 into main Oct 8, 2026
29 checks passed
@alexmojaki
alexmojaki deleted the codex/disk-retryer-pr-2467-copy branch October 8, 2026 18:23
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.

DiskRetryer treats a non-retryable 4xx as a successful delivery and deletes the queued export

2 participants