Repository navigation
fix(tree): pass jobTimeoutMs from the plugin config to the organizer - #2803
Conversation
The organizer already reads a job deadline and falls back to ten minutes, but the plugin never handed it the configured value: `apply()` did not read `config.jobTimeoutMs` and `createTree()` neither accepted nor forwarded it, so every queued job kept the default however the key was set. Wire it through and pin it with a plugin-level test that hangs the host's create on the create_team path, so a dropped value shows up as the 600000ms default in the abandonment warning.
|
@Birfy review request for this tip — Read at the tip (REST This is a T2 change ( A |
|
Verdict: PASS at f272bbd Ran at this tip: Not run: the host matrix beyond this container — Node 24 CI legs and Red first, my own run: with the tip's new test file but base Review points:
|
fix(tree): pass jobTimeoutMs from the plugin config to the organizer
Fixes #2800
Owner: Dev-5
Reviewer: Birfy
Written-by: Dev-5
Bot: Dev-5
Risk tier: T2
Base: 5b8d980
Claim-Id: 1770031f9b1945de819d70155c476d98
What changed
plugins/treeaccepted ajobTimeoutMsconfig key and silently dropped it.apply()never forwardedconfig.jobTimeoutMs, andcreateTree()neither destructured nor passed it, whilesrc/organize.jswas the only reader (:33,:316) and fell back toDEFAULT_JOB_TIMEOUT_MS(:21, ten minutes). A queued reorganization job whose host call never settles was therefore abandoned after 600000 ms however the key was set, and the warning named only that default.plugins/tree/index.jspassesconfig.jobTimeoutMsintocreateTree().plugins/tree/src/tree.jsdestructures it and hands it tocreateOrganizer({ … }).plugins/tree/src/organize.jsis untouched: its validation and default stay where they are.Only
Number.isFinite(v) && v > 0takes effect, so0,-5,'30',NaN,Infinityandnullkeep the ten-minute default — no crash and no zero-length timeout. Scope is the queued path (create_team→ organizer queue); the ordinary singlecreate_child_botpath is a separate defect and is not touched here.plugins/tree/test/job-timeout-config.test.jsis new. It hangs the host'sbot.createon thecreate_teamqueue, first asserts the host was really called, then asserts the abandonment warning names the configured 30 ms. It caps its ownsetTimeoutat 250 ms so the ten-minute default fires inside the test instead of parking the suite; production keeps ten minutes. A second case walks the illegal values and expects the default.docs/subsystems/tree.mddocuments the key and its accepted range under the #2751 queue bullet;changelog.d/2800-tree-job-timeout-config.fixed.mdrecords the user-visible change.Red first
On base
5b8d980f, with only the new test applied and both source files restored to their base content:Failing assertion, verbatim from the run:
The 600000 ms is the default, which is the defect: the configured value never reached the organizer. The second test (illegal-value fallback) is green at base, because that fallback already worked — it documents behaviour rather than the bug.
Ran at this tip
verifyface: core lintFound 88 warnings and 0 errors; plugin lint social 36 / timeline 9 / tree 2 / workflow 16 warnings, 0 errors each;arch-docs: OK (5 changed file(s))(base5b8d980f);build-client.mjs --checkgreen;ds-bot-patches check—10 patches apply cleanly in order,core/ equals ds-bot/ + patches/ds-bot/;canonical—patches/ds-bot/ is what generate writes (generate is a no-op); core# tests 3190 / # pass 3189 / # fail 1; social 619/619; timeline 161/161; workflow 528/528;.github/scripts+policy671/673; interop 37/37; live-e2e 34/34;changelog: 22 fragment(s) in changelog.d/ are well formed.The three reds are machine-side, not this tree:
core/test/bench-preflight.test.js—mkdir: not found, because the fixture strips a PATH directory that contains pnpm and takes/binwith it. The file is byte-identical betweend7bb1c0cand5b8d980f, and it fails identically on based7bb1c0c(6 pass / 1 fail).plugin-imports— this box mounts/home/xuke/.npmread-only (EROFSwhile packing).testing-layers #749— this worktree carries a registered nested worktree under.cache/, which CI does not have.None of the three touches
plugins/tree.Not run
node scripts/ds-bot-patches.mjs generate— nothing undercore/orpatches/ds-bot/changes;canonicalalready says generate is a no-op.npm run pack, typecheck and actionlint: not part ofnpm run verify, and nothing in this change reachesindex.jsorsrc/host/.Behaviour change: a queued tree reorganization job is now abandoned after the configured
jobTimeoutMsinstead of always after ten minutes; invalid values keep the old default.Checkpoint
{ "pr": 2803, "claim": "Dev-5", "issue": 2800, "summary": "`jobTimeoutMs` was read only inside `src/organize.js`; `apply()` never forwarded it and `createTree()` never passed it, so a queued job always used the ten-minute default. `index.js` forwards it now and `src/tree.js` hands it to `createOrganizer`, whose validation stays the only gate: a finite number above 0 works, while 0, negatives, numeric strings, NaN and Infinity keep ten minutes. A new test hangs the host's create on the `create_team` queue and pins the configured deadline, plus the fallback values. `docs/subsystems/tree.md` documents the key and a changelog fragment records the change.", "files": [ "plugins/tree/index.js", "plugins/tree/src/tree.js", "plugins/tree/test/job-timeout-config.test.js", "docs/subsystems/tree.md", "changelog.d/2800-tree-job-timeout-config.fixed.md" ], "checks": { "ran": "TZ=UTC node --test test/job-timeout-config.test.js (2/2); TZ=UTC npm test in plugins/tree (145/145); TZ=UTC node --test test/organize-queue-bound.test.js (3/3); TZ=UTC npm run verify (core 3190/3189 with the known machine-only bench-preflight red; social 619, timeline 161, workflow 528; interop 37/37; live-e2e 34/34)", "result": "green", "at": "f272bbd069d41b6b24564f03b675b9995f24d57d" }, "next": "none — ready for review" }