aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/flood.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-20 02:12:15 +0000
committertv <tv@krebsco.de>2026-11-20 03:23:41 +0100
commit00cac6466057c2a8a92dae9e4cd46369e72bcad9 (patch)
treeb41fccb378577c7e653e9df8e46940787bd2278d /src/swarm/flood.rs
parentdf5727174c92d74f625806e747557dbf4991d999 (diff)
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.
Diffstat (limited to 'src/swarm/flood.rs')
0 files changed, 0 insertions, 0 deletions