Back off QIT 429 retries in CLI - #471
Open
zhongruige wants to merge 1 commit into
Open
Conversation
zhongruige
marked this pull request as ready for review
July 8, 2026 22:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the qit-cli pieces of QIT-991:
Retry-Afterconsistently for HTTP 429 responses.Retry-Afterthan the CLI retry budget allows.Root Cause
Vendor runs could burst multiple Manager API requests and signed ZIP downloads through the WordPress.com/Atomic edge. The edge can return HTTP 429 with an HTML body before QIT PHP runs. The CLI previously retried some Manager 429s with a flat wait, did not retry static ZIP 429s cleanly, could keep retrying polls every second after failures, and reused upload retry state across chunks.
Manual Testing
Recommended setup:
--verbosefor CLI runs so retry/wait messages are visible.429for the first request and then succeeds.Normal package download still works
Transient ZIP download 429 recovers
429once, then HTTP200.--verbose.Persistent ZIP download 429 fails cleanly
429with an HTML body.Manager API
Retry-Afteris respected429withRetry-After: 120, then succeed.429with aRetry-Aftervalue greater than 180 seconds.Remote test polling backs off after failures
/wp-json/cd/v1/get-singlepolling to fail or return HTTP429for a few attempts.Chunked upload keeps a fresh retry budget per chunk
UPLOAD_CHUNK_KBin a test run so the upload uses several chunks.429and then succeed.429responses instead of failing because an earlier chunk consumed the retry budget.