Skip to content

Replace batch-barrier queue drain with a rolling four-repository scheduler - #498

Merged
maryliag merged 5 commits into
mainfrom
copilot/fix-49998002-1279488627-83478a5e-fd81-40e0-a227-7194766ff0a5
Oct 28, 2026
Merged

maryliag merged 5 commits into
mainfrom
copilot/fix-49998002-1279488627-83478a5e-fd81-40e0-a227-7194766ff0a5

Conversation

Copilot AI commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Remove the queue drain's batch barrier so a slow repository no longer leaves workers idle while other repositories have queued work.

The drain currently claims up to 16 queue items and processes their repositories with four workers. Workers can pick up more repositories within that batch, but the next claim waits for the entire batch to finish. Near the end of a batch, one slow repository can leave three workers idle.

For example, if a batch contains repositories A, B, C, and D, and B, C, and D finish first, repositories E, F, and G in the queue must still wait for A. This PR lets them start alongside A.

Rolling scheduling

Keep one four-worker pool for the drain. Whenever a repository job finishes, claim eligible work for the available slots without waiting for the other jobs.

Each job still processes a bounded group of items from one repository, preserving sequential processing and coalesced publication. New claims exclude repositories already running in that lane. The live and maintenance lanes each retain their existing four-repository limit.

Deadline and retry behavior

Stop admitting jobs ten minutes before the hard processing deadline, replacing the estimate based on the longest completed batch. Running jobs keep the existing deadline and lease protections, and remaining work passes to the successor drain.

If admission stops after a claim, return unstarted items to the queue without consuming retries or marking them complete. If a newer event arrived during the claim, its follow-up gets a fresh retry budget.

This changes scheduling, not dashboard evaluation or publication rules. Stable/canary code selection, delivery leases, and the promoted release remain unchanged. The expected benefit is less idle time between batches, not higher concurrency; no end-to-end speedup has been measured yet.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-10-28 13:09 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI changed the title [WIP] Copilot Request Replace batch-barrier queue drain with a rolling four-repository scheduler Oct 26, 2026
Copilot AI requested a review from trask October 26, 2026 21:21
@trask
trask requested a balanced review from Copilot October 26, 2026 21:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The refill loop can start additional repository jobs after an existing job has already failed, violating the intended stop-on-failure behavior.

1 open issue
What changed in this PR

Replaces batch-based dashboard queue draining with a rolling scheduler that refills available repository slots without waiting for slower jobs.

Changes:

  • Adds persistent four-repository scheduling, admission deadlines, and per-repository job handling.
  • Extends the claim API with repository exclusions and limits, and locks shared execution caches.
  • Updates scheduler and API tests and documents rolling execution.
File Description
pull-request-dashboard/​README.md Describes rolling queue processing.
.github/​scripts/​pull-request-dashboard/​test_owned_execution.py Adapts owned-execution tests to repository jobs.
.github/​scripts/​pull-request-dashboard/​test_drain_queue.py Covers rolling scheduling, concurrency, and failure handling.
.github/​scripts/​pull-request-dashboard/​test_dashboard_queue.mjs Tests repository filtering and claim limits.
.github/​scripts/​pull-request-dashboard/​test_dashboard_queue_worker.mjs Tests endpoint validation and filter forwarding.
.github/​scripts/​pull-request-dashboard/​RATIONALE.md Updates the scheduling rationale.
.github/​scripts/​pull-request-dashboard/​netlify/​lib/​dashboard-queue.mjs Adds repository-aware claim selection.
.github/​scripts/​pull-request-dashboard/​netlify/​functions/​dashboard-queue-worker.mjs Validates and forwards optional claim filters.
.github/​scripts/​pull-request-dashboard/​execution_code.py Locks shared code and checkout caches.
.github/​scripts/​pull-request-dashboard/​drain_queue.py Implements rolling repository jobs and slot refill.
.github/​scripts/​pull-request-dashboard/​CONTEXT.md Documents scheduling, deadlines, and checkout reuse.

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 26, 2026 21:39
@trask
trask requested a balanced review from Copilot October 26, 2026 21:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unstarted claims can be incorrectly dead-lettered, an empty-claim race can delay scheduling, and an overlap test depends on thread timing.

3 open issues
1 resolved since last review

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Requeueing dirty claims retains the previous generation’s retry count, which can prematurely dead-letter follow-up work.

1 open issue
3 resolved since last review

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 26, 2026 23:46
@trask
trask requested a balanced review from Copilot October 26, 2026 23:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues remain, and regression coverage addresses scheduling races, admission cutoffs, and retry-preserving requeue behavior.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@trask
trask marked this pull request as ready for review October 27, 2026 02:21
@trask
trask requested a review from a team as a code owner October 27, 2026 02:21
@maryliag
maryliag merged commit 2b4a315 into main Oct 28, 2026
7 checks passed
@maryliag
maryliag deleted the copilot/fix-49998002-1279488627-83478a5e-fd81-40e0-a227-7194766ff0a5 branch October 28, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants