FORGE-79: executor lanes; survive max_instances; raise pool capacity #714

Closed
gmackie wants to merge 0 commits from FORGE-79-executor-lanes into main
Owner

Issue: https://tasks.gmac.io/gmacko/issue/FORGE-79 · enables FORGE-77's fg-shadow lane · fixes a capacity incident caused by #695

Incident (2026-10-12 ~04:42 UTC)

After #695 moved every PR's unit suites to cloudflare, ~10 runs' worth of jobs exceeded the container app's max_instances 8. Every start threw Maximum number of running container instances exceeded, so each pool tick failed before saving state (lastTick stopped updating) and /run returned 1101. 14 jobs queued and PRs' required checks blocked. Mitigation was deployed live: this code with max_instances 32. Cloudflare then provisioned capacity (rollout 21→32), and the pool resumed (one tick started 10 containers).

Changes

  • Capacity: max_instances 8 → 32, pool in-flight 6 → 16. A rejected start is now recorded on the tick (capped) and retried next tick instead of failing the tick.
  • Lanes (src/lanes.ts): the pool and containers serve a list of runner registrations (LANES JSON: url, uuid, label, secret names, optional job-search URL, maxInFlight, enabled). With LANES unset, the single legacy cloudflare lane is built exactly as before (tested), so the Forgejo lane is unchanged. Adding FORGE-77's fg-shadow lane against the ForgeGraph control plane is then config plus secrets.
  • Push model: POST /pool/wake?lane=&pending= (admin bearer). /run takes ?lane=. One lane's job search failing doesn't stall the others.
  • Validation rejects non-https URLs, non-UUIDs, bad labels, duplicate names, and token values pasted where a secret name belongs.

Tests

node --test 9/9 (6 planner, 3 lanes), and tsc is clean. Deployed: version d52efa89 (capacity) on top of b7ce1973 (lanes); /pool shows per-lane state.

🤖 Generated with Claude Code

Issue: https://tasks.gmac.io/gmacko/issue/FORGE-79 · enables FORGE-77's fg-shadow lane · fixes a capacity incident caused by #695 ## Incident (2026-10-12 ~04:42 UTC) After #695 moved every PR's unit suites to `cloudflare`, ~10 runs' worth of jobs exceeded the container app's **max_instances 8**. Every start threw `Maximum number of running container instances exceeded`, so each pool tick failed before saving state (`lastTick` stopped updating) and `/run` returned 1101. 14 jobs queued and PRs' required checks blocked. Mitigation was deployed live: this code with max_instances 32. Cloudflare then provisioned capacity (rollout 21→32), and the pool resumed (one tick started 10 containers). ## Changes - **Capacity:** `max_instances` 8 → 32, pool in-flight 6 → 16. A rejected start is now recorded on the tick (`capped`) and retried next tick instead of failing the tick. - **Lanes** (`src/lanes.ts`): the pool and containers serve a list of runner registrations (`LANES` JSON: url, uuid, label, secret *names*, optional job-search URL, maxInFlight, enabled). **With `LANES` unset, the single legacy `cloudflare` lane is built exactly as before** (tested), so the Forgejo lane is unchanged. Adding FORGE-77's `fg-shadow` lane against the ForgeGraph control plane is then config plus secrets. - Push model: `POST /pool/wake?lane=&pending=` (admin bearer). `/run` takes `?lane=`. One lane's job search failing doesn't stall the others. - Validation rejects non-https URLs, non-UUIDs, bad labels, duplicate names, and token values pasted where a secret *name* belongs. ## Tests `node --test` 9/9 (6 planner, 3 lanes), and `tsc` is clean. Deployed: version d52efa89 (capacity) on top of b7ce1973 (lanes); `/pool` shows per-lane state. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(ci): executor lanes; survive max_instances; raise pool capacity (FORGE-79)
Some checks failed
CF executor smoke / smoke (pull_request) Successful in 11s
CI / unit-api (pull_request) Successful in 3m22s
CI / unit-web (pull_request) Successful in 3m50s
CI / gitleaks (pull_request) Successful in 9s
CI / storybook (pull_request) Successful in 1m56s
CI / checks (pull_request) Successful in 1m55s
CI / database (pull_request) Successful in 1m51s
CI / ci (pull_request) Has been cancelled
CI / web-build (pull_request) Has been cancelled
CI / go (pull_request) Has been cancelled
7a1c779a77
Lanes: the pool and containers now serve a list of runner registrations
(LANES JSON: url, uuid, label, secret names, job-search URL), so the same
image and pool can run FORGE-77's fg-shadow lane against the ForgeGraph
control plane next to Forgejo's cloudflare lane. Without LANES the single
legacy cloudflare lane is built exactly as before (tested). Push-model
lanes get an authenticated POST /pool/wake?lane=&pending=. /run takes
?lane=. One lane's control plane failing does not stall the others.

Capacity incident, 2026-10-12 ~04:42 UTC: after #695 sent every PR's unit
suites to cloudflare, ~10 runs' worth of jobs exceeded max_instances 8.
Each start threw 'Maximum number of running container instances
exceeded', so every pool tick failed before recording state, and /run
returned 1101. With 14 jobs waiting, PRs' required checks blocked.
Rejected starts are now recorded ('capped') and retried on the next tick.
max_instances goes 8 -> 32 and pool in-flight 6 -> 16.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Author
Owner

Updated: the real cause of the stuck queue was not the lane. 8 main push runs were serialized behind run #3449, whose ci aggregate waited ~50 min for a node slot. The pool counted their (unclaimable) jobs as waiting and launched containers that idled up to 40 min, filling max_instances. Added a claim deadline to the entrypoint (exit if nothing is claimed within 180s; tested in-image with a stub runner) and pushed image poc2 (deployed). Pool in-flight is set to 4. The ci aggregate on node slots is what #711 fixes. 🤖 Generated with Claude Code

Updated: the real cause of the stuck queue was not the lane. 8 **main** push runs were serialized behind run #3449, whose `ci` aggregate waited ~50 min for a node slot. The pool counted their (unclaimable) jobs as waiting and launched containers that idled up to 40 min, filling max_instances. Added a **claim deadline** to the entrypoint (exit if nothing is claimed within 180s; tested in-image with a stub runner) and pushed image `poc2` (deployed). Pool in-flight is set to 4. The ci aggregate on node slots is what #711 fixes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
gmackie force-pushed FORGE-79-executor-lanes from 7a1c779a77
Some checks failed
CF executor smoke / smoke (pull_request) Successful in 11s
CI / unit-api (pull_request) Successful in 3m22s
CI / unit-web (pull_request) Successful in 3m50s
CI / gitleaks (pull_request) Successful in 9s
CI / storybook (pull_request) Successful in 1m56s
CI / checks (pull_request) Successful in 1m55s
CI / database (pull_request) Successful in 1m51s
CI / ci (pull_request) Has been cancelled
CI / web-build (pull_request) Has been cancelled
CI / go (pull_request) Has been cancelled
to 25302eac1c
Some checks failed
CI / unit-api (pull_request) Has started running
CF executor smoke / smoke (pull_request) Successful in 21s
CI / unit-web (pull_request) Failing after 1m35s
CI / gitleaks (pull_request) Has been cancelled
CI / storybook (pull_request) Has been cancelled
CI / web-build (pull_request) Has been cancelled
CI / checks (pull_request) Has been cancelled
CI / database (pull_request) Has been cancelled
CI / go (pull_request) Has been cancelled
CI / ci (pull_request) Has been cancelled
2026-10-12 05:13:02 +00:00
Compare
gmackie force-pushed FORGE-79-executor-lanes from 25302eac1c
Some checks failed
CI / unit-api (pull_request) Has started running
CF executor smoke / smoke (pull_request) Successful in 21s
CI / unit-web (pull_request) Failing after 1m35s
CI / gitleaks (pull_request) Has been cancelled
CI / storybook (pull_request) Has been cancelled
CI / web-build (pull_request) Has been cancelled
CI / checks (pull_request) Has been cancelled
CI / database (pull_request) Has been cancelled
CI / go (pull_request) Has been cancelled
CI / ci (pull_request) Has been cancelled
to eb6132e66a
Some checks failed
CF executor smoke / smoke (pull_request) Successful in 14s
CI / gitleaks (pull_request) Has been cancelled
CI / storybook (pull_request) Has been cancelled
CI / web-build (pull_request) Has been cancelled
CI / checks (pull_request) Has been cancelled
CI / database (pull_request) Has been cancelled
CI / go (pull_request) Has been cancelled
CI / ci (pull_request) Has been cancelled
CI / unit-api (pull_request) Has been cancelled
CI / unit-web (pull_request) Has been cancelled
2026-10-12 05:18:51 +00:00
Compare
gmackie force-pushed FORGE-79-executor-lanes from eb6132e66a
Some checks failed
CF executor smoke / smoke (pull_request) Successful in 14s
CI / gitleaks (pull_request) Has been cancelled
CI / storybook (pull_request) Has been cancelled
CI / web-build (pull_request) Has been cancelled
CI / checks (pull_request) Has been cancelled
CI / database (pull_request) Has been cancelled
CI / go (pull_request) Has been cancelled
CI / ci (pull_request) Has been cancelled
CI / unit-api (pull_request) Has been cancelled
CI / unit-web (pull_request) Has been cancelled
to 64067e9c6a
All checks were successful
CF executor smoke / smoke (pull_request) Successful in 16s
CI / unit-api (pull_request) Successful in 4m4s
CI / gitleaks (pull_request) Successful in 10s
CI / unit-web (pull_request) Successful in 5m32s
CI / go (pull_request) Successful in 57s
CI / storybook (pull_request) Successful in 1m27s
CI / web-build (pull_request) Successful in 1m48s
CI / database (pull_request) Successful in 3m16s
CI / checks (pull_request) Successful in 3m45s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 38s
2026-10-12 05:20:34 +00:00
Compare
Author
Owner

This PR is merged: main has merge commit 34fd414b (05:42:30Z). The ForgeGraph merge call timed out but succeeded; Forgejo never updated this PR's status, so merge retries got 405 "try again later". Leaving it to Forgejo to settle; if it stays open, it can be closed. 🤖 Generated with Claude Code

This PR is merged: main has merge commit 34fd414b (05:42:30Z). The ForgeGraph merge call timed out but succeeded; Forgejo never updated this PR's status, so merge retries got 405 "try again later". Leaving it to Forgejo to settle; if it stays open, it can be closed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Closing: every commit on this branch is already contained in main (0 commits ahead), and ForgeGraph already records the changeset as merged. Backlog cleanup under FORGE-271.

Closing: every commit on this branch is already contained in main (0 commits ahead), and ForgeGraph already records the changeset as merged. Backlog cleanup under FORGE-271.
gmackie closed this pull request 2026-10-30 07:40:05 +00:00
All checks were successful
CF executor smoke / smoke (pull_request) Successful in 16s
CI / unit-api (pull_request) Successful in 4m4s
CI / gitleaks (pull_request) Successful in 10s
Required
Details
CI / unit-web (pull_request) Successful in 5m32s
CI / go (pull_request) Successful in 57s
CI / storybook (pull_request) Successful in 1m27s
CI / web-build (pull_request) Successful in 1m48s
CI / database (pull_request) Successful in 3m16s
CI / checks (pull_request) Successful in 3m45s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 38s
Required
Details

Pull request closed

Sign in to join this conversation.
No description provided.