From 00cac6466057c2a8a92dae9e4cd46369e72bcad9 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 Nov 2026 02:12:15 +0000 Subject: mycelium: wait in the daemon only while nothing else is asked of it Mycelium holds its node's lock for as long as a request for the inbox waits for a message, and every other request waits for that lock, the messages we send among them: with two polls of up to five minutes, a node with nothing coming in sent nothing until a message came in (each send timing out after ten seconds), so two idle nodes never reached each other, a node joining a federation whose only node was its founder's among them. The inbox is waited for by one request, and only while nothing else is asked of the daemon: a send, or a seed's lookup, takes a turn (`Turn`), which drops the waiting request, freeing the daemon's lock as its API drops a request whose client went away. While turns are under way, the poller takes what is there without waiting, again as each begins or ends; then it waits again. It waits peeking, the message left in the inbox, and pops it after without waiting, so a request dropped while it waited takes nothing with it. Nothing is asked of the daemon again and again: an idle node has one request waiting there, for up to five minutes. The warnings about the daemon's API name the error's causes, not only which request failed. --- docs/transports.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/transports.md b/docs/transports.md index a8f914e..2b1b07e 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -42,6 +42,12 @@ free one without). Its key is its identity on the overlay, and so its address: `--mycelium-key-create` makes it on the first start. `--mycelium-network-key-file` and `--mycelium-network-name` join a private Mycelium network instead of the public one. +The node waits in its daemon for what comes in, one request at a time, while it asks +nothing else of it: the daemon holds back every other request while one waits for a +message, the node's own messages among them. So a message to send, or a seed to look up, +drops the waiting request first, and until the node waits again it takes what came in +without waiting, as each of its other requests begins or ends. + `--mycelium-rest-url` uses a daemon running elsewhere, through its REST API, instead of supervising one; then the options above don't apply: those of a supervised daemon can't be combined with it ([`configuration.md`](configuration.md), unsetting and conflicting options), and -- cgit v1.3.1