Skip to content

Comments

fix: retry transient HTTP errors (502/503/504/429) during session polling#55

Open
peterfoldes wants to merge 2 commits intomainfrom
peter/retry-transient-http-errors
Open

fix: retry transient HTTP errors (502/503/504/429) during session polling#55
peterfoldes wants to merge 2 commits intomainfrom
peter/retry-transient-http-errors

Conversation

@peterfoldes
Copy link
Contributor

Summary

The session status polling retry logic treated all requests.HTTPError as non-retryable, causing transient errors like 502 Bad Gateway to immediately fail the connection instead of retrying within the 15-minute wait window. This uses tenacity's composable retry_if_exception predicate to retry on transient HTTP status codes (429, 502, 503, 504) while still failing immediately on permanent errors (401, 403, 404, etc.).

Related Issues

Observed in Airflow canary tests for aws-ap-south-1 where a 502 during session polling immediately killed the task.


Requester Checklist

Complete these before marking Ready for Review

  • I have self-reviewed my own code
  • I have added/updated tests that prove my fix/feature works
  • I have included visual proof (screenshot, video, or test output) if applicable
  • All CI checks are passing
  • PR size is S/M, OR I have justified the size and added a walkthrough
  • I have updated documentation if needed

…ling

The session status polling retry logic treated all requests.HTTPError as
non-retryable, causing transient errors like 502 Bad Gateway to
immediately fail the connection instead of retrying. This changes the
retry strategy to use tenacity's composable retry_if_exception predicate
to distinguish transient HTTP errors (429, 502, 503, 504) from permanent
ones (401, 403, 404), matching the industry-standard status_forcelist
from urllib3.util.Retry.
@peterfoldes peterfoldes marked this pull request as ready for review February 21, 2026 04:52
@peterfoldes peterfoldes requested a review from a team as a code owner February 21, 2026 04:52
@peterfoldes peterfoldes requested review from ClayMav, mpetazzoni and zongsizhang and removed request for a team February 21, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant