Skip to content

fix: respect Retry-After header on HTTP 429 responses (#938)#939

Closed
ayash911 wants to merge 1 commit intoKaggle:mainfrom
ayash911:fix/retry-after-header
Closed

fix: respect Retry-After header on HTTP 429 responses (#938)#939
ayash911 wants to merge 1 commit intoKaggle:mainfrom
ayash911:fix/retry-after-header

Conversation

@ayash911
Copy link
Copy Markdown

Fixes #938

The Kaggle CLI was ignoring the Retry-After header on HTTP 429 responses. This PR:

  • Adds _is_rate_limited() and _get_retry_after_delay() to detect 429s and parse the Retry-After header (supports both integer seconds and HTTP-date formats per RFC 9110)
  • Updates with_retry() and download_file() to use the server-specified delay instead of blind exponential backoff
  • Adds verbose rate-limit logging via self.logger (enabled with VERBOSE=true)
  • Includes 15 new unit tests — all passing, 0 warnings

@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 25, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ayash911
Copy link
Copy Markdown
Author

@googlebot I signed it.

@ayash911 ayash911 marked this pull request as draft March 25, 2026 18:56
@ayash911 ayash911 marked this pull request as ready for review March 25, 2026 18:56
@ayash911 ayash911 closed this Mar 25, 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.

BugFix: Retry-After is not respected by kaggle servers

1 participant