CB-553: enforce maxLoad on explicit-profile spawns #27

Closed
agent wants to merge 1 commits from worker/cb-553-maxload-explicit-spawn-305ee3-6 into main
Member

The placement policy — the only place maxLoad was read — is bypassed when a spawn names a profile explicitly, so the documented cap (BridgedConfig.Worker#maxLoad) was dead config on the normal path. Right now 4 live workers sit on gx10 whose maxLoad is 2.

Enforce the cap on the explicit-profile branch of CompositePeerLauncher.spawn: resolve the profile's maxLoad from profileConfigs, compare against liveCount, and throw PlacementException when live >= cap (null/absent maxLoad ⇒ unlimited, never capped). No silent fallback to another profile — the caller named it for cost/model reasons. TOCTOU race (liveCount read outside any lock; SessionManager registers only after spawn returns) documented in a comment, not fixed, matching the existing placement path.

Unqualified/placement path untouched; existing placement tests unchanged.

Tests: +3 in CompositePeerLauncherTest (at-cap throws + message names profile/live/cap, under-cap succeeds, null maxLoad never capped). mvn clean install: Tests run: 543, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS

The placement policy — the only place maxLoad was read — is bypassed when a spawn names a profile explicitly, so the documented cap (BridgedConfig.Worker#maxLoad) was dead config on the normal path. Right now 4 live workers sit on gx10 whose maxLoad is 2. Enforce the cap on the explicit-profile branch of CompositePeerLauncher.spawn: resolve the profile's maxLoad from profileConfigs, compare against liveCount, and throw PlacementException when live >= cap (null/absent maxLoad ⇒ unlimited, never capped). No silent fallback to another profile — the caller named it for cost/model reasons. TOCTOU race (liveCount read outside any lock; SessionManager registers only after spawn returns) documented in a comment, not fixed, matching the existing placement path. Unqualified/placement path untouched; existing placement tests unchanged. Tests: +3 in CompositePeerLauncherTest (at-cap throws + message names profile/live/cap, under-cap succeeds, null maxLoad never capped). mvn clean install: Tests run: 543, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS
agent added 1 commit 2026-08-13 21:12:50 +02:00
CB-553: enforce maxLoad on explicit-profile spawns (no cap bypass)
CI / build (pull_request) Successful in 56s
CI / contract (pull_request) Successful in 1m16s
37b4031ca4
Owner

Closing as landed — main has 3a7ef0a / merge 15b53c6. Verified with git cherry main worker/cb-553-maxload-explicit-spawn-305ee3-6: the commit's content is present in main (patch-id match), the tip differs only from the rebase. No code is lost. Verified 2026-08-15.

Note: issue #25 (CB-553) can close with this.

Closing as **landed** — `main` has `3a7ef0a` / merge `15b53c6`. Verified with `git cherry main worker/cb-553-maxload-explicit-spawn-305ee3-6`: the commit's content is present in `main` (patch-id match), the tip differs only from the rebase. No code is lost. Verified 2026-08-15. Note: issue #25 (CB-553) can close with this.
ltms closed this pull request 2026-08-15 07:11:03 +02:00
Some checks are pending
CI / build (pull_request) Successful in 56s
CI / contract (pull_request) Successful in 1m16s

Pull request closed

Sign in to join this conversation.