← Back to Pull requests

perf(ci): wake listeners on demand and reduce capacity reads #3138

Closed
unknown closed this pull request without merging on Nov 30, 2026 11:22 UTC
View on GitHub
unknown unknown commented on Nov 27, 2026 10:05 UTC
Author

TL;DR

Idle repositories keep their scale-set listeners closed, and active listeners retain each queued workflow job until its departure is confirmed.

How it works

If one of 100 authorized repositories queues a job, a signed webhook or an authorized repository scan wakes that repository’s requested runner label. The other 99 need no scale-set session or capacity probe.

sequenceDiagram
    participant Q as Durable job inbox
    participant L as Listener
    participant G as GitHub Actions
    Q->>L: Jobs A and B queued for the same label
    L->>G: Advertise one available slot
    G-->>L: One offer acquired
    Note over Q,L: Both job IDs stay pending
    G-->>Q: Job A is in progress
    Q->>L: Job B is still queued
    L->>G: Poll when capacity returns

The inbox deduplicates demand by installation and workflow job ID. An empty poll or partial acquisition preserves the pending jobs across a restart. A confirmed status change clears only the matching job, and an older scan result preserves a newer notice.

Each due repository scan reads at most eight notice rows in one indexed query inside the claim transaction. Its cursor advances with the existing task write. Only jobs absent from the queued inventory need individual GitHub status checks, and a 404 leaves the job pending.

Assigned jobs, pending acquisitions, reservations and workers awaiting retirement keep their labels recoverable.

Hosted capacity probes validate scope metadata in one fenced read and read mutable counters once. An empty credential-retirement page skips its separate database-clock read. Listener documentation · Repository compensation · Design

Verification

With the review fixes reverted, one acquired offer or an empty poll cleared queued notices, and a standalone personal-token scan left a canceled job pending. The regression cases pass with the fixes applied on SQLite and PostgreSQL for listener polling and on standalone SQLite for personal-token reconciliation.

The shared listener suite, standalone runner suite, selected hosted CI suites and both builds passed. Production SQL QPS, cold-job latency and compensation API volume still require measurement after rollout.

The design review flagged limited independent verification of external sources. It suggested checking notice settlement across restart, lost custom-label webhooks, overlapping poll versions, reservations changing between reads, and malformed unlimited-domain counters. The regression suite covers restart, custom-label compensation and overlapping notifications.

The commit audit noted that a status confirmed by a scan saves the observed notice version and repeats job identity fields in the job fact. This adds payload bytes to those records.

Diff: 384 lines (+288 / -96) across 4 files Reviewer: DefeatMan Review duration: 4396m
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 384 lines diff across 4 files
0.43
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.356
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3138"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 43% (MEDIUM) · Higher = larger blast radius
43%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 17.0% · Safe to merge
17.0%