Skip to content

fix: retry HTTP 429 responses with bounded backoff - #8

Draft
illuminati1911 wants to merge 1 commit into
masterfrom
http-429-retries
Draft

illuminati1911 wants to merge 1 commit into
masterfrom
http-429-retries

Conversation

@illuminati1911

Copy link
Copy Markdown
Collaborator

Summary

  • Retry HTTP 429 before response extraction, respecting retry_over_query_limit; disabling retries raises HTTPError(429) even with custom extractors.
  • Honor Retry-After delay-seconds and HTTP dates; missing or invalid values use the existing jittered backoff.
  • Bound HTTP 429 waits by the remaining retry_timeout and check the deadline before retry requests, including mixed-status chains.
  • Close rate-limited responses before retrying or raising, and add regression coverage, client documentation, and a changelog entry.

The existing transient-status set omits HTTP 429: https://github.com/googlemaps/google-maps-services-python/blob/d3b71ab1333cff0f900d2db6b39c1356341a5ea2/googlemaps/client.py#L49-L51

Header handling follows RFC 9110: https://www.rfc-editor.org/rfc/rfc9110.html#section-10.2.3

Verification

On Python 3.10.20:

  • python -m pytest tests/test_client.py — 43 passed, including 17 new retry tests.
  • python -m pytest — 122 passed.
  • Real localhost HTTP checks passed for 429 recovery, header/date handling, invalid-header fallback, opt-out including custom extraction, timeout enforcement, and existing 503 retries. No Google Maps requests or real credentials were used.
  • nox --download-python never -s docs --force-python 3.10 — passed; visually inspected the changed documentation and rendered changelog.
  • Diff/whitespace checks passed.

The prescribed Python 3.7 docs build remains unverified because that interpreter is unavailable. The Python 3.10 build is supplemental. Tests ran directly using the repository's test dependencies, avoiding the automatic Codecov upload.

@illuminati1911 illuminati1911 self-assigned this Oct 19, 2026
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.

1 participant