Repository navigation
fix(github): postpone GraphQL throttling until quota resets - #1148
Open
Tmwakalasya wants to merge 1 commit into
Open
Tmwakalasya wants to merge 1 commit into
Tmwakalasya wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Why?
GitHub can report GraphQL throttling inside HTTP 200 responses or as HTTP 403. The change provider and validator currently return those failures as non-retryable, so the consumer rejects the delivery instead of waiting for quota to recover. A local response-fixture reproduction failed for both callers; HTTP 429/503 and permission-error controls behaved as expected.
What?
Preserve recognized GraphQL throttling as a typed error with a retry deadline. Honor
Retry-Afterand, when remaining quota is zero,X-RateLimit-Reset; use the later deadline when both apply. Missing, malformed, or expired deadlines use a one-minute cooldown, following GitHub's guidance.Register a GitHub classifier in the orchestrator and let the consumer postpone retryable errors carrying the optional
errs.RetryDeadlinecontract. ExistingSendRequestcallers keep their signature and behavior; an additive helper retains response headers. Ordinary permission failures remain permanent, and explicit permanent classifications still take precedence.Postponement uses the existing durable queue operation: it resets retry accounting and creates a partition barrier. Repeated throttling can therefore keep a partition waiting indefinitely. Already buffered deliveries and other partitions can still call GitHub; this is not a token-wide rate limiter. REST clients are outside this change. Failed postponement leaves the delivery in flight for visibility-timeout recovery.
Test Plan
platform/http, the GitHub change provider, and the GitHub validator.platform/githubapiandplatform/consumer../tool/bazel run @rules_go//go -- test -mod=readonly. Its Bazel test target could not build because zlib rejects an absolute Xcode SDKSettings.json include.make fmt,make lint,make check-tidy,make check-gazelle, focused pinned-Go vet, and whitespace checks.Issue
No linked issue. Found while tracing GitHub failure classification.