Expand description
A message to an agent of a LAN peer that is down is kept on the senderβs instance for 24 hours and delivered when the peer answers again, as a message to a stopped local agent is. Before this it went to the cloud relay, which drops it after 30 minutes if no install of the account picks it up; a machine that was off for an hour lost it (task #2228).
The agent counts as a known peerβs when a LAN peer listed it (backend::lan::seen_agents, kept
across restarts) and that peer no longer answers its poll. A peer that does answer is left to the
old path: it can start a stopped agent when the message reaches it, which a held copy here cannot.
The relay keeps the message when it says another install of the account runs the agent, or cannot
say (absent_route_for), as for a local agent that is absent.
The row lives in db_jekt_held under the target key peer:<route name>, which no agent UID can be,
so the replay for local agents never sees it.
EnumsΒ§
- Sent π
- What one held message came to on a replay pass.
ConstantsΒ§
- AGENTS_
PER_ πPASS - LOOKUPS_
PER_ πPASS - Agents one replay pass looks at (their machine may be down, which costs only a cached lookup), agents it sends to, and messages it sends to one.
- MAX_
REFUSALS π - Refusals by a peer that has the agent, before a held message is dropped (as for a local agent).
- PEER_
KEY_ πPREFIX - The target key of a message held for a peerβs agent.
- POLL_
FRESH_ πSECS - A peer whose last answered poll is older than this is not answering (polls run every 30 s).
- ROWS_
PER_ πAGENT
FunctionsΒ§
- down_
host π - The host that listed the agent, when no live LAN peer of that name answers its poll now.
- hold_
for_ πdown_ peer - Hold
reqfor an agent of a LAN peer that is down.Noneleaves it to the relay and the other holds: the hold does not apply to this sender, the agent is not a known peerβs, its machine is answering, it is defined here, or the relay has it. - hold_
for_ πpeer - The hold itself, for
hold_for_down_peerandhold_for_silent_peer. - hold_
for_ πsilent_ peer - Hold
reqfor an agent of a LAN peer that answers its polls but gave no answer to this message (its inbound check was stuck behind a cloud login refresh that never returned). The replay sends it again; the peer that receives it can still start a stopped agent, which this copy cannot. - late_
message π messagewith the note that it was sent earlier, when it has waited long enough to need one.- peer_
key π - relay_
has_ πit - Whether the relay should take the message for
nameinstead: another install of the account runs it, or the relay cannot say (an older one). A relay that is not reachable, or a sender not signed in to it, has nothing to offer, so the message is kept here. - replay_
pass π - One pass over the messages held for peersβ agents: each agent now on the LAN gets its messages, oldest first; one the relay has (another install runs it) goes there. Run beside the replay for local agents, whose pass also drops what expired.
- request_
for π - The request a held row is sent as: addressed by the name the sender used, late messages marked.
- rotated π
keysstarting at theby-th, so each pass looks first at a different agent.- send_
over_ πlan - send_
over_ πrelay - send_
row π - One held message, sent over the LAN (
lan) or the relay, unless it ran out while the pass was asking where its agent is or sending the ones before it. The peer that receives it cannot tell. - settle π
- spent π
- Whether a rowβs 24 h hold, or the senderβs own deadline, has run out: it is dropped, not sent.