Wait for a stopped bundle's exit instead of sleeping after it (issue 476) #30

Merged
mesh-admin merged 1 commits from fix/476-wait-for-the-exit into main 2026-10-12 09:03:48 +00:00
Contributor

Fixes novox/hq issue 476 (the tool runner's caller tests wait half a second instead of waiting for a stopped bundle's exit).

Change

  • launch.Start reads the restart pauses (RestartFirst, RestartMost, RestartSettle) once, at start. The exit goroutine no longer reads the package variables, so it cannot race a test that sets them.
  • Each child now has a handled channel, closed when its exit goroutine has finished. Launched.Stop sends SIGTERM and then waits for that channel, for at most StopWait (5 s). Nothing of a stopped bundle runs on after Stop returns.
  • caller_test.go drops settled and its 500 ms sleep and uses defer stop().

Evidence (shanks, 24 cores loaded by 24 busy-loop shells, race detector on, -count=200 of the two caller tests plus the two events tests, 800 test runs each):

  • main: 1 FAIL, a DATA RACE between events_test.go:133 (writes launch.RestartFirst) and launch.go:390 (reads it in the exit goroutine).
  • this branch: 0 FAIL, 0 races, 800 of 800 passed.

go vet and go test -race pass on internal/launch and internal/runtime.

Fixes novox/hq issue 476 (the tool runner's caller tests wait half a second instead of waiting for a stopped bundle's exit). **Change** - `launch.Start` reads the restart pauses (`RestartFirst`, `RestartMost`, `RestartSettle`) once, at start. The exit goroutine no longer reads the package variables, so it cannot race a test that sets them. - Each child now has a `handled` channel, closed when its exit goroutine has finished. `Launched.Stop` sends SIGTERM and then waits for that channel, for at most `StopWait` (5 s). Nothing of a stopped bundle runs on after Stop returns. - `caller_test.go` drops `settled` and its 500 ms sleep and uses `defer stop()`. **Evidence** (shanks, 24 cores loaded by 24 busy-loop shells, race detector on, `-count=200` of the two caller tests plus the two events tests, 800 test runs each): - main: 1 FAIL, a DATA RACE between events_test.go:133 (writes `launch.RestartFirst`) and launch.go:390 (reads it in the exit goroutine). - this branch: 0 FAIL, 0 races, 800 of 800 passed. `go vet` and `go test -race` pass on `internal/launch` and `internal/runtime`.
mesh-admin added 1 commit 2026-10-12 08:53:20 +00:00
Wait for a stopped bundle's exit instead of sleeping after it
mesh/delivery delivered
mesh/merge-gate pass: builds mesh-tools, node-tools → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of …
mesh/repo-check pass: its merge-check.sh passed
494d0787e2
Launched.Stop now returns once the bundle's exit is handled, bounded by
StopWait, and the launcher reads its restart pauses once at Start, so
the exit goroutine no longer races a test that changes them. The caller
tests drop their half-second pause (novox/hq issue 476).
Author
Contributor

Delivery novox/mesh-tools@494d0787e272 — delivered since 2026-10-12T09:12:37Z

Delivery plan — builds mesh-tools, node-tools → ace, g14, novox, shanks; no bus step

  • tier 0: mesh-tools, node-tools
  • ace: receives node-tools
  • g14: receives node-tools
  • novox: receives node-tools
  • shanks: receives node-tools
  • node-tools provides mcp-endpoint: its consumers are sent again after it
  • grants step: if this changes what the bus's user list says (a new tool, subject or user), novox is sent that list alone, every build there kept, before node-tools is judged on its first machine

Machines

  • mesh-host on ace: passed — healthy 3 times over 2m40s
  • mesh-tools on every machine running it: sent
  • node-tools on ace: passed — judged with mesh-host: healthy 3 times over 2m40s
  • mesh-host on the rest running it: sent
  • node-tools on the rest running it: sent

Transitions

  • 2026-10-12 08:53 (new) → proposed (announced): novox/mesh-tools#30's head announced
  • 2026-10-12 08:56 proposed → checked (checked): the verdict names this commit
  • 2026-10-12 08:56 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
  • 2026-10-12 09:08 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
  • 2026-10-12 09:08 published → delivering (go): its walk started: let go by this owner in its group's order, by a person, or on the controller's own path — not a failed walk that carried a later commit for it, after which it waits for a walk of its own commit
  • 2026-10-12 09:12 delivering → delivered (done): its walk is done, carrying its own commit: every machine of its deploy plan passed, or was left as its policy says

The commit's note under refs/notes/mesh-plan keeps every transition: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-tools@494d0787e272` — **delivered** since 2026-10-12T09:12:37Z **Delivery plan** — builds mesh-tools, node-tools → ace, g14, novox, shanks; no bus step - tier 0: mesh-tools, node-tools - ace: receives node-tools - g14: receives node-tools - novox: receives node-tools - shanks: receives node-tools - node-tools provides mcp-endpoint: its consumers are sent again after it - grants step: if this changes what the bus's user list says (a new tool, subject or user), novox is sent that list alone, every build there kept, before node-tools is judged on its first machine **Machines** - mesh-host on ace: passed — healthy 3 times over 2m40s - mesh-tools on every machine running it: sent - node-tools on ace: passed — judged with mesh-host: healthy 3 times over 2m40s - mesh-host on the rest running it: sent - node-tools on the rest running it: sent **Transitions** - 2026-10-12 08:53 (new) → proposed (announced): novox/mesh-tools#30's head announced - 2026-10-12 08:56 proposed → checked (checked): the verdict names this commit - 2026-10-12 08:56 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail - 2026-10-12 09:08 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move - 2026-10-12 09:08 published → delivering (go): its walk started: let go by this owner in its group's order, by a person, or on the controller's own path — not a failed walk that carried a later commit for it, after which it waits for a walk of its own commit - 2026-10-12 09:12 delivering → delivered (done): its walk is done, carrying its own commit: every machine of its deploy plan passed, or was left as its policy says The commit's note under `refs/notes/mesh-plan` keeps every transition: `git log --notes=mesh-plan`.
Author
Contributor

Merge check at 494d0787

  • mesh/merge-gate: PASS — every machine composes with the change as it did without (4 of 4 compose) (modules: mesh-tools, node-tools)
  • mesh/repo-check: PASS — its merge-check.sh passed

Delivery plan — builds mesh-tools, node-tools → ace, g14, novox, shanks; no bus step

  • tier 0: mesh-tools, node-tools
  • ace: receives node-tools
  • g14: receives node-tools
  • novox: receives node-tools
  • shanks: receives node-tools
  • node-tools provides mcp-endpoint: its consumers are sent again after it
  • grants step: if this changes what the bus's user list says (a new tool, subject or user), novox is sent that list alone, every build there kept, before node-tools is judged on its first machine

Run by the build seat on ace as build-1791795226788320954 (builds --log build-1791795226788320954).

--- the gate: mesh-tools, node-tools
mesh-tools: ok
node-tools: ok, invokes every tool
long-running resources without health: 0
files asking for a setting without saying whether it is trusted: 0
2 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here
judging 0 module(s) changed against 4 machine(s), as the snapshot of 2026-10-12T08:35:24Z says they run
composing every machine as the mesh is
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
composing every machine with the change
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose)
judged by controller development build against the facts of 2026-10-12T08:35:24Z

machines:
  - a machine (f35): composes
  - holds mesh-dns-resolver (idt): composes
  - holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes
  - a machine (yvbpsm): composes

a merge would rebuild 2 module(s) in 1 tier(s): mesh-tools, node-tools
--- its merge-check.sh (go toolchain)
NOT TESTED HERE: internal/runtime and internal/console launch bundles that need node and @novox/mesh-sdk
?   	github.com/novox/mesh-tools/node-tools/cmd/node-tools	[no test files]
ok  	github.com/novox/mesh-tools/node-tools/internal/alive	1.195s
ok  	github.com/novox/mesh-tools/node-tools/internal/announce	4.369s
ok  	github.com/novox/mesh-tools/node-tools/internal/bus	12.532s
ok  	github.com/novox/mesh-tools/node-tools/internal/launch	1.074s
ok  	github.com/novox/mesh-tools/node-tools/internal/meshtest	1.132s
?   	github.com/novox/mesh-tools/node-tools/internal/wire	[no test files]
ok  	github.com/novox/mesh-tools/node-tools/internal/console	0.006s
ok  	github.com/novox/mesh-tools/node-tools/internal/runtime	1.996s
NOT TESTED HERE: node-tools/src (TypeScript) needs @novox/mesh-sdk from the package registry
**Merge check** at `494d0787` - `mesh/merge-gate`: **PASS** — every machine composes with the change as it did without (4 of 4 compose) (modules: mesh-tools, node-tools) - `mesh/repo-check`: **PASS** — its merge-check.sh passed **Delivery plan** — builds mesh-tools, node-tools → ace, g14, novox, shanks; no bus step - tier 0: mesh-tools, node-tools - ace: receives node-tools - g14: receives node-tools - novox: receives node-tools - shanks: receives node-tools - node-tools provides mcp-endpoint: its consumers are sent again after it - grants step: if this changes what the bus's user list says (a new tool, subject or user), novox is sent that list alone, every build there kept, before node-tools is judged on its first machine Run by the build seat on ace as `build-1791795226788320954` (`builds --log build-1791795226788320954`). ``` --- the gate: mesh-tools, node-tools mesh-tools: ok node-tools: ok, invokes every tool long-running resources without health: 0 files asking for a setting without saying whether it is trusted: 0 2 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here judging 0 module(s) changed against 4 machine(s), as the snapshot of 2026-10-12T08:35:24Z says they run composing every machine as the mesh is the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued composing every machine with the change the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose) judged by controller development build against the facts of 2026-10-12T08:35:24Z machines: - a machine (f35): composes - holds mesh-dns-resolver (idt): composes - holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes - a machine (yvbpsm): composes a merge would rebuild 2 module(s) in 1 tier(s): mesh-tools, node-tools --- its merge-check.sh (go toolchain) NOT TESTED HERE: internal/runtime and internal/console launch bundles that need node and @novox/mesh-sdk ? github.com/novox/mesh-tools/node-tools/cmd/node-tools [no test files] ok github.com/novox/mesh-tools/node-tools/internal/alive 1.195s ok github.com/novox/mesh-tools/node-tools/internal/announce 4.369s ok github.com/novox/mesh-tools/node-tools/internal/bus 12.532s ok github.com/novox/mesh-tools/node-tools/internal/launch 1.074s ok github.com/novox/mesh-tools/node-tools/internal/meshtest 1.132s ? github.com/novox/mesh-tools/node-tools/internal/wire [no test files] ok github.com/novox/mesh-tools/node-tools/internal/console 0.006s ok github.com/novox/mesh-tools/node-tools/internal/runtime 1.996s NOT TESTED HERE: node-tools/src (TypeScript) needs @novox/mesh-sdk from the package registry ```
mesh-admin merged commit aee834aeb6 into main 2026-10-12 09:03:48 +00:00
mesh-admin deleted branch fix/476-wait-for-the-exit 2026-10-12 09:03:49 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-tools#30