Serve a tools bundle as soon as it is in place, changed or gone, with no restart; say why a bundle cannot start (issue 1945)

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.
This commit is contained in:
2026-10-25 15:09:49 +01:00
parent 77b05089c8
commit b0ded57294
5 changed files with 858 additions and 130 deletions
+12
View File
@@ -198,6 +198,18 @@ func (p *provisionWatches) told(module string, changed bus.ProvisionChanged) []*
return out
}
// stopModule stops every watch of one module, whose bundle is loaded again.
func (p *provisionWatches) stopModule(module string) {
p.mu.Lock()
defer p.mu.Unlock()
for w := range p.of[module] {
w.mu.Lock()
w.stopped = true
w.mu.Unlock()
}
delete(p.of, module)
}
func (p *provisionWatches) stopAll() {
p.mu.Lock()
defer p.mu.Unlock()