node-tools serves a tools bundle as soon as it is placed, changed or removed, with no restart, and says why a bundle cannot start (issue 1945) #42

Merged
mesh-tools merged 3 commits from fix/r6-reload-bundles into main 2026-10-25 14:56:22 +00:00
Member

Issue 1945 (R6 recovery, fix 13; criteria AC19-22 in note 25).

node-tools read its bundles only at start, so a bundle delivered later was served only after a restart.

  • Reload on change (b0ded57): an inotify watch on the bundles' folders loads a bundle placed or changed, and drops a removed one, with no restart. A bundle that cannot start says its real reason.
  • Review round 1 (d8ac699): an event heard during a reload is refused instead of read from a nil map (the panic), and a bundle is judged by its entrypoint alone, so files it writes beside itself never reload it.
  • Review round 2 (2cd5550): a stopped tool drops its membership handler (HandleCalled keeps onMembership's unregister), so a replaced bundle's old tools never come back on the next membership. A stopped bundle refuses calls instead of starting an unmanaged copy, and a start that raced Stop is terminated. dropModule runs before unload. arm re-climbs to a directory that appears while it watches. Bundle stderr is stripped of ANSI colour codes before its failure reason is kept.

Tests include TestABundleWritingBesideItselfIsNotLoadedAgainByIt and TestAReplacedBundlesOldToolStaysGoneOnTheNextMembership (the reviewer's scenario, which failed first). TestTheNodesRuntimeServesFiveModulesAndFollowsAReissuedMembership now passes on a machine that forces colour.

Checked: go vet with and without -tags integration, and go test -race on ./node-tools/internal/... Tries passed on d8ac699 and 2cd5550 (try-1792939461256770221). The operator decided no checks run during the recovery (2026-10-25 15:53, issue 1945 note 27): the operator merges by hand.

Known, not caused by this change: bus TestAConsumerDeletedAndMadeAgainIsHeardAgain flakes on main too (1 in 8 under -race); it is fixed separately.

Reviewed-by: reviewer-r6n@shanks at 2cd5550dc7

Issue 1945 (R6 recovery, fix 13; criteria AC19-22 in note 25). node-tools read its bundles only at start, so a bundle delivered later was served only after a restart. - **Reload on change** (b0ded57): an inotify watch on the bundles' folders loads a bundle placed or changed, and drops a removed one, with no restart. A bundle that cannot start says its real reason. - **Review round 1** (d8ac699): an event heard during a reload is refused instead of read from a nil map (the panic), and a bundle is judged by its entrypoint alone, so files it writes beside itself never reload it. - **Review round 2** (2cd5550): a stopped tool drops its membership handler (HandleCalled keeps onMembership's unregister), so a replaced bundle's old tools never come back on the next membership. A stopped bundle refuses calls instead of starting an unmanaged copy, and a start that raced Stop is terminated. dropModule runs before unload. arm re-climbs to a directory that appears while it watches. Bundle stderr is stripped of ANSI colour codes before its failure reason is kept. Tests include TestABundleWritingBesideItselfIsNotLoadedAgainByIt and TestAReplacedBundlesOldToolStaysGoneOnTheNextMembership (the reviewer's scenario, which failed first). TestTheNodesRuntimeServesFiveModulesAndFollowsAReissuedMembership now passes on a machine that forces colour. Checked: go vet with and without -tags integration, and go test -race on ./node-tools/internal/... Tries passed on d8ac699 and 2cd5550 (try-1792939461256770221). The operator decided no checks run during the recovery (2026-10-25 15:53, issue 1945 note 27): the operator merges by hand. Known, not caused by this change: bus TestAConsumerDeletedAndMadeAgainIsHeardAgain flakes on main too (1 in 8 under -race); it is fixed separately. Reviewed-by: reviewer-r6n@shanks at 2cd5550dc70fc5c20b589f5825f0b684d50996f0
mesh-tools added 3 commits 2026-10-25 14:55:23 +00:00
node-tools loaded every bundle once at start, so a bundle delivered after
it started (mesh-files on shanks, 2026-10-25 12:08) went unserved until a
hand restart, and a missing file was said as "not executable". The
runtime now watches the entrypoints' directories with inotify, loads a
module again once a burst of changes settles, and discovery answers with
what is served now. A bundle that cannot start says it does not exist, is
not executable with its mode, or the exec error.

Tests: 1945/AC19-AC22 in internal/runtime/reload_test.go.
An event a module's consumer heard after the module was dropped for a
reload read a deleted entry and panicked node-tools, taking every tool on
the machine down. The handler now refuses an event of a consumer that is no
longer the module's, and a stopped hearing hands nothing on and offers the
event again at once.

A bundle that writes beside itself (a cache, a socket) loaded itself again
after every quiet spell, because the signature took in every file in its
directory. A delivery puts every file in place anew, so the entrypoint alone
tells a new build. The watch also looks once as it begins, so a bundle that
came between its load and the watch is not missed.

Tests: 1945/AC23 and AC24 in internal/runtime/reload_test.go, and a stopped
hearing in internal/bus/hearing_stopped_test.go.
A stopped tool drops its membership handler and a stopped bundle starts no copy on a call, so a replaced bundle's old tools stay gone (issue 1945, review round 2)
mesh/delivery merged: source.main moved to novox/mesh-tools@5d6cee9d844e
mesh/check pass 2cd5550dc70f on 77b05089c8df | unit 0 run 126 kept | int 0 run 128 kept | clone 9.5s | composition passed on 4 machines
2cd5550dc7
Its events are refused before the old bundle stops, the bundle watch follows a directory made between
its stat and its watch, and a bundle's reason is read without node's colour codes.
Author
Member

Delivery novox/mesh-tools@2cd5550dc70f — merged since 2026-10-25T14:56:23Z

Source — source.main moved to novox/mesh-tools@5d6cee9d84. Whether it reached the machines is mesh-delivery-view's, derived from source.main, the wants and the haves.

Transitions

  • 2026-10-25 14:55 (new) → proposed (announced): novox/mesh-tools#42's head announced
  • 2026-10-25 14:55 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail
  • 2026-10-25 14:56 ready → merged (merged): on the trunk its modules follow: merged there

The commit's note under refs/notes/mesh-plan keeps every transition of this change up to its merge: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-tools@2cd5550dc70f` — **merged** since 2026-10-25T14:56:23Z **Source** — source.main moved to novox/mesh-tools@5d6cee9d844e. Whether it reached the machines is `mesh-delivery-view`'s, derived from `source.main`, the wants and the haves. **Transitions** - 2026-10-25 14:55 (new) → proposed (announced): novox/mesh-tools#42's head announced - 2026-10-25 14:55 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail - 2026-10-25 14:56 ready → merged (merged): on the trunk its modules follow: merged there The commit's note under `refs/notes/mesh-plan` keeps every transition of this change up to its merge: `git log --notes=mesh-plan`.
mesh-tools merged commit 5d6cee9d84 into main 2026-10-25 14:56:22 +00:00
mesh-tools deleted branch fix/r6-reload-bundles 2026-10-25 14:56:23 +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#42