Repository navigation
fix(ghapp): serve queued jobs of pending runs - #37
Merged
Merged
Conversation
GitHub reports a run as pending while it waits to start, for example behind a concurrency group, and its jobs are already queued. The controller listed only queued and in_progress runs, so such a job was never served (Polity run 39189840366 waited 25+ minutes).
Contributor
Author
|
Review of 4282be3: ship.
Checks run on 4282be3, with
Not merged. |
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.
Problem
A job can be
queuedinside a run whose status ispending. GitHub reports a run that way while it waits to start, for example behind a concurrency group.QueuedJobslisted runs only withstatus=queuedandstatus=in_progress, so the controller never saw such a job and it waited forever. Seen live: adecidejob labelledself-hosted, railway-private, queued for 25+ minutes in a pending run while the pool was idle.Fix
Also list
status=pendingruns. The job-level filter is unchanged: onlyqueuedjobs whose labels we can take are returned.Tests
TestQueuedJobsIncludeQueuedJobsOfPendingRuns: failed before the fix, passes after.go test ./...andgo vetare clean.Cost: one extra conditional GET per repo per cycle, usually a 304 that doesn't count against the rate limit.