Repository navigation
fix(github): bound the App mint by the read deadline, cache failures - #533
Merged
Merged
Conversation
A mint ignored the 4 second page read limit, so a hung GitHub held /gh pages for the mint's own 15 seconds on each read. A failed mint was not remembered, so every read tried a new one and reported it, and the sync paced on the fallback token the whole time. A read now passes its deadline to the mint it waits for. A failed mint stands for about 60 seconds per isolate with one event. A deadline that ends a mint is no failure, and a 401 on a minted token still re-mints once inside a window.
1 of 6 tasks
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.
🔗 Linked issue
Related to #525
❓ Type of change
📚 Description
Two findings from the review of #525 and #526:
/ghpage read waits at mostGITHUB_PAGE_READ_TIMEOUT_MS(4 s) for GitHub. The installation token mint it waited for ignored that limit. If GitHub hung, each page read could wait the mint's own 15 s.app-token-unavailableevent, and then read withGITHUB_TOKEN.What changes:
readWithGithubCredentialtakes the read'sdeadline, anAbortSignal, and passes it tocurrent()andrenew(). The registry client passes the signal behindtimeoutMs. A read waits for a mint no longer than its deadline. It then rejects with the deadline's reason, as its own request would. The sync and builds pass no deadline, so their mint keeps the 15 s limit.app-misconfiguredevent per window, not one per read.The runbook in
docs/ops/artifact-delivery-rollout.mdnow describes the window and the deadline.