diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-14 09:40:23 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-14 09:40:23 +0200 |
| commit | d4b37774118a2689c67b2ad802b9763f2ef448fd (patch) | |
| tree | 22a287709879f822cc3751842804f2c64c6a80d4 /packages/meshbay-node/src/meshbay_node/platform.py | |
| parent | 211ace6cc0168647e00bcc20a909aead50b8ad0a (diff) | |
| download | meshbay-d4b37774118a2689c67b2ad802b9763f2ef448fd.tar.gz | |
fix(node): a reload and a plug rescan outlive the session that asked
A root added from the client arrives over MNP, and _retarget_indexer
started the daemon's reload with the session's own _spawn. When that
session closed - a client reconnecting 47 s into the scan of a 900 GB
root - shutdown_tasks() cancelled the reload mid-scan, and the reload
queued behind it, without a line in the log. The new root was in
node.toml and in the indexer's set but never in the group's context; the
lock was free and nothing retried, so the node served the old roots table
for hours while reconcile hashed the whole drive as missed events. One
loopback reload fixed the live node in 9 ms.
_reload_config now runs the work in a node-owned task and awaits it
through asyncio.shield, so a caller that goes away only stops waiting; a
cancelled reload is logged. plug_root does the same for its rescan, which
drops the root's entries before walking the disk and so left the root
empty when its admin op's session closed.
The existing MNP test replaced _spawn with a list and could not cancel
anything; the new tests close the session for real and fail without this.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6jPTeocXA1BePekdsgPya
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/platform.py')
0 files changed, 0 insertions, 0 deletions