Skip to content

Commit 2b4a315

Browse files
Copilottrask
andauthored
Replace batch-barrier queue drain with a rolling four-repository scheduler (#498)
* Initial plan * Schedule dashboard queue repository jobs on a rolling basis Co-authored-by: trask <218610+trask@users.noreply.github.com> * Stop scheduler admission after job failures Co-authored-by: trask <218610+trask@users.noreply.github.com> * Safely requeue unstarted dashboard claims Co-authored-by: trask <218610+trask@users.noreply.github.com> * Reset attempts for dirty unstarted requeues Co-authored-by: trask <218610+trask@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: trask <218610+trask@users.noreply.github.com>
1 parent 8b81295 commit 2b4a315

11 files changed

Lines changed: 1110 additions & 375 deletions

File tree

‎.github/scripts/pull-request-dashboard/CONTEXT.md‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,16 @@ waiting for its request lease to expire. Whichever run acquires a runner first
9696
must win activation; duplicate or stale runs cannot claim work. The drain has no
9797
GitHub concurrency group, so an unassigned old run cannot block its replacement.
9898

99-
`drain_queue.py` keeps one heartbeat across preparation and all processing
100-
waves. It runs up to four repositories concurrently and processes each
101-
repository serially. Stable and canary claims both use `process_queue_batch.py`,
99+
`drain_queue.py` keeps one heartbeat across preparation and all processing.
100+
It schedules rolling repository jobs: one coordinator keeps up to four jobs
101+
running in a persistent thread pool and, whenever any job finishes, claims
102+
eligible work for the free slots while the other jobs continue. Each job
103+
processes a bounded group of claims for one repository serially, so claim
104+
grouping and coalesced publication are unchanged. Claims exclude repositories
105+
that already have an active job in the lane and are capped to the free slots,
106+
oldest eligible work first. New jobs stop being admitted ten minutes before the
107+
processing deadline; running jobs remain fenced by that hard deadline and the
108+
lease monitor, and the successor handoff is unchanged. Stable and canary claims both use `process_queue_batch.py`,
102109
not workflow dispatch as a completion signal. The processing path covers
103110
calculation, accepted-state persistence, delivery, issue publication, and
104111
full-publication receipt updates. Coalesced publication must succeed before
@@ -123,7 +130,7 @@ authority. Repository policy comes from the current worker checkout in both
123130
channels. Stable repositories do not run main's evaluation or state codecs.
124131

125132
Owned processors use an independent shallow Git clone per target repository,
126-
reused across waves within a drain. Each clone has its own configuration, refs,
133+
reused across jobs within a drain. Each clone has its own configuration, refs,
127134
objects, and worktree registrations, with `origin` pointing to shared-workflows
128135
for accepted-state and delivery transactions. Clones are seeded locally from the
129136
worker checkout; immutable scripts and dependency environments remain shared by

‎.github/scripts/pull-request-dashboard/RATIONALE.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ the implementation understandable and operationally cheap.
1111
- Target repositories only need GitHub App access and an entry in
1212
`repositories.json`.
1313
- The top-level workflow validates targets and enqueues work. Independent live
14-
and maintenance drains process up to four repositories concurrently; each
15-
repository remains serial within a wave. A failure in one repository does
14+
and maintenance drains keep up to four repository jobs running and start
15+
the next eligible repository as soon as any job finishes; each repository
16+
remains serial within a lane. A failure in one repository does
1617
not prevent the others from processing.
1718
- Calculated state and delivery intent for each target repository live on a
1819
worker-owned branch under

0 commit comments

Comments
 (0)