Repository navigation
fix(workflow): spawn run Bots with bounded concurrency (#3286) - #3287
Merged
Merged
Conversation
A run created its node Bots one at a time. A host answers a spawn in about ten seconds, so a six-node lane needed ~66s and missed the 60s batch deadline; a five-node lane had ~5s of slack (#3286). Spawn four at a time so the same lane takes two waves (~20s). A refused spawn stops new starts, lets the ones in flight land, and error.spawned still lists every Bot that was made; the result keeps the graph nodes in their own order. Fixes #3286 Written-by: Dev
Collaborator
Author
|
Verdict: PASS at 534c2c8 Ran at this tip: Review notes (tip 534c2c8, base 747e009):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written-by: Dev
Fixes #3286
Owner: Dev
Reviewer: Reviewer
What changed
A run created its node Bots one at a time, so a six-node line could not fit the 60s batch deadline (
SPAWN_DEADLINE_MS) and a five-node line was a coin flip.spawnAllnow creates up toSPAWN_CONCURRENCY = 4at once (the width is a parameter tests can inject). A refused spawn starts no further Bot, the ones already in flight are awaited and still land inerror.spawned(creation order), and the returned map keeps the graph's node order whatever order the host answers in. The deadline sentence's "needs about Ns" estimate now counts waves, and progress names the last-started node the host has not answered, so #3282's node name and reason still work with several spawns in flight.Before / after
Verification at the tip
Tip SHA: 534c2c8
Ran:
cd plugins/workflow && DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test "test/*.test.js"— 544 tests, 544 pass, 0 fail.node core/scripts/build-client.mjs --check— ok (no client change).node scripts/ds-bot-patches.mjs check— ok, 10 patches.node .github/scripts/changelog.mjs check— ok.node scripts/lint-plugins.mjsand oxlint overcore— 0 errors (warnings are pre-existing).Not run (and why):
npm run verifycould not complete on this box:corehere has nodev/harnessoxlint install andarch-docsneedsgit+origin/main, and this host has nogit. The affected workflow suite, the client check, the patch check, the changelog check and lint were run as above;core/is untouched.Red first
Source unchanged, new test only (
plugins/workflow/test/parallel-spawn.test.js): 1 of 3 pass, 2 fail —never more than four spawns in flight: 1(the serial loop) andtwo spawns are in flight: actual ["node-1"]. The same two tests pass after the change.Checkpoint
{ "pr": 3287, "claim": "Dev", "issue": 3286, "summary": "spawnAll creates run Bots four at a time instead of one after another, so a six-node lane needs two waves (~22s) and fits the 60s batch deadline. A refused spawn starts no new Bot, awaits the ones in flight, and error.spawned lists every Bot made in creation order. The returned map follows the graph's node order, and the timeout sentence's estimate counts waves.", "files": ["plugins/workflow/src/ephemeral.js", "plugins/workflow/src/service.js", "plugins/workflow/test/parallel-spawn.test.js", "docs/subsystems/workflow.md", "changelog.d/3286.fixed.md"], "checks": { "ran": "cd plugins/workflow && DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test 'test/*.test.js'", "result": "green", "at": "534c2c860eb0c8470cb2082ee437b5d75042cc6f" }, "next": "none — ready for review" }