← 输入框|github.com|刷新
Skip to content

fix(events): retry event POSTs after transient HTTP errors - #531

Open
Alex Castillo González (pcbeingused33) wants to merge 1 commit into
optimizely:masterfrom
pcbeingused33:fix/c3543-retry-event-posts
Open

Alex Castillo González (pcbeingused33) wants to merge 1 commit into
optimizely:masterfrom
pcbeingused33:fix/c3543-retry-event-posts

Conversation

@pcbeingused33

Copy link
Copy Markdown

Fixes #528

Summary

Event dispatch configures retries for transient 5xx responses, but urllib3's default retry policy excludes POST. A temporary 503 therefore fails the dispatch on the first attempt, after the batch has already been removed from the queue.

Include POST in the existing retry policy so event batches can be retried after transient HTTP failures. The retry count, backoff, and status list stay the same.

allowed_methods / Retry.DEFAULT_ALLOWED_METHODS need urllib3 1.26 or newer. The requirements do not pin urllib3, so a urllib3>=1.26 floor can be added if you want it.

Test plan

  • python -m unittest tests.test_event_dispatcher exercises the real requests adapter with a mocked HTTP transport that returns 503 then 200. On master the regression test sees one attempt. With the fix it sees two attempts and no dispatch error.
  • python -m unittest tests.test_config_manager covers the shared helper's datafile consumer.
  • ruff check . passes.

Prepared with OpenAI Codex assistance.

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.

Event POST requests are not retried after transient 5xx responses

1 participant