Design 47 H1: the tool runner re-serves a membership without dropping a call; its integration level fits its bound (H-A-158, H-A-160) #80

Merged
mesh-tools merged 4 commits from fix/47-H1-node-tools-integration-bound into main 2026-11-20 16:49:43 +00:00
4 Commits
Author SHA1 Message Date
jschoubben 8ee4fdfb8e H1 integration bound: a reload's stand-in serves no repairs; stop waits its Say
Review round 1. A ledger binding heard while a module was loaded again
made refreshRepairs serve the repairs on the reload's stand-in, whose
subscriptions nobody stopped: the repairs were served twice, and still
answered after the runtime stopped. The stand-in is now marked as
reloading and the refresh leaves it alone; the reload serves the module's
repairs as its binding is when the load ends. The reload test holds a
bundle's start, issues the binding inside the reload, and asks a repair
after the runtime stopped: without the change it still answered (6 of 6
runs, GOMAXPROCS=1 and 24).

No test failed without keep's stop waiting for the heartbeat's goroutine.
The heartbeat test now holds one Say and stops meanwhile: stop must not
return before that Say has; without the wait it failed 50 of 50 runs at
GOMAXPROCS=1 and at 24.

Builds: design 47 H §774, H-A-160; principle 11
2026-11-20 17:45:50 +01:00
jschoubben 05deea5952 H1 integration bound: the repairs' refresh keeps the tools it still serves
When a module's ledger binding came or went, refreshRepairs stopped every
subscription of its tools and served them all again, so a call in that
gap was dropped the same way as on a membership (H-A-158). serve is now
the one routine that changes a module's subscriptions, by tool address:
it keeps those still named, subscribes the new, then stops those no
longer named; refreshRepairs and the first serve both go through it, so
no tool is served twice or not at all.

The ledger test's later binding now comes and goes ten times, and the
module's own tool must answer the first call after each, within the
tests' 2 s bound; it failed without the change at GOMAXPROCS=1 and 24.

Builds: design 47 H §774, H-A-158, H-A-160; principle 11
2026-11-20 17:28:34 +01:00
jschoubben 3850eb8eac H1 integration bound: the heartbeat and the counter tests hold under load
TestTheRuntimeSaysItIsThereEveryInterval slept 70 ms and wanted three
beats at 20 ms: a loaded machine that did not schedule the heartbeat in
time failed it (main.20's integration step on the build node); and its
stop returned before the heartbeat's goroutine ended, so a beat could be
said after it ("said after it was stopped"). The ticks are now the
caller's (keep, beside Keep's own ticker), the test drives them and waits
on each beat, and stop returns once nothing more is said. Pinned to one
processor at idle priority beside six busy loops, the old test failed 13
of 100 runs; the new passes 100 of 100.

TestTwoWritersIncrementingOneCounterOnTheBusLoseNoUpdate bounded a
writer's tries at 1000, a guess: on one processor the scheduler lets one
writer win every round and the other lost its 1000 tries every time. A
write is lost only to the other writer's write, so the bound is the
other's count plus one.

Builds: design 47 H §774; principle 11
2026-11-20 17:23:59 +01:00
jschoubben eb174d853f H1 integration bound: the runner follows a membership without dropping a call
On every membership of a module, HandleCalled stopped each subscription
of a tool and subscribed again on the same subjects; a call the bus
routed in that window was dropped by the client in silence, and its
caller waited the runner's whole bound (30 s). On the build node this
was the 30 s of TestAReplacedBundlesOldToolStaysGoneOnTheNextMembership
and of TestTheLedgerRepairsAreToolsOfEveryLedgerOwner, and most of the
integration level's 72 s. Now a membership keeps every subscription whose
subject and queue it still names, subscribes the new ones, and only then
stops those it no longer names (make before break).

The test asks the served tool once after each of five memberships, with
the tests' own call bound of 2 s (principle 11); it fails without the
change. The runtime tests' call helper and the ledger listing wait that
bound, not the runner's 30 s.

Builds: design 47 H §774, H-A-158; principle 11
2026-11-20 17:18:09 +01:00