diff options
| author | Vaidas Pilkauskas <vaidas.pilkauskas@shopify.com> | 2026-03-17 13:00:35 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-17 09:14:19 -0700 |
| commit | 640657ffd06999ec1ec3b1d030b7f5aac6b7f57b (patch) | |
| tree | 2c64d3e66fb76d7125fc9552a9358880319ff906 /strbuf.c | |
| parent | a4fddb01c5bd0ecbd5e297ee571ad29ca62bf940 (diff) | |
| download | git-640657ffd06999ec1ec3b1d030b7f5aac6b7f57b.tar.xz | |
http: add support for HTTP 429 rate limit retries
Add retry logic for HTTP 429 (Too Many Requests) responses to handle
server-side rate limiting gracefully. When Git's HTTP client receives
a 429 response, it can now automatically retry the request after an
appropriate delay, respecting the server's rate limits.
The implementation supports the RFC-compliant Retry-After header in
both delay-seconds (integer) and HTTP-date (RFC 2822) formats. If a
past date is provided, Git retries immediately without waiting.
Retry behavior is controlled by three new configuration options
(http.maxRetries, http.retryAfter, and http.maxRetryTime) which are
documented in git-config(1).
The retry logic implements a fail-fast approach: if any delay
(whether from server header or configuration) exceeds maxRetryTime,
Git fails immediately with a clear error message rather than capping
the delay. This provides better visibility into rate limiting issues.
The implementation includes extensive test coverage for basic retry
behavior, Retry-After header formats (integer and HTTP-date),
configuration combinations, maxRetryTime limits, invalid header
handling, environment variable overrides, and edge cases.
Signed-off-by: Vaidas Pilkauskas <vaidas.pilkauskas@shopify.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.c')
0 files changed, 0 insertions, 0 deletions
