Skip to main content

Module lan_watch

Module lan_watch 

Source
Expand description

One WARN line for an incoming LAN request that is refused, hangs or times out.

On 2026-11-12 a machine refused or never answered every remote operation from another for 17 hours, and its log had nothing about it: srv logs inbound LAN HTTP at INFO only when a request is delivered, so the one request that matters, the one that never gets through, left no line. A middleware on the three routes a LAN peer posts to (/agentmux/reactive/inject, /agentmux/remote/op, /agentmux/reactive/inject-files) writes the line, and handlers mark the stage they are at (stage) where they wait on something, so a hang names what it waits on.

A line names the route, the peer’s address and machine, the agent the request claims to come from (nothing is proven yet at most stages), the stage, how long, and why. Never a request body, a key or a token. A peer retrying every few seconds writes one line a minute per reason, with how many it stood for. App health carries the counts since start (lan_refusals).

StructsΒ§

Event πŸ”’
Everything one line says.
Limits πŸ”’
When a line was last written for each source and reason, and how many were left out since.
Watch πŸ”’
What one watched request has said about itself so far.

EnumsΒ§

Kind πŸ”’

ConstantsΒ§

LINE_EVERY_SECS πŸ”’
A line per source and reason at most this often; the ones left out are counted on the next.
MAX_ANSWER_BYTES πŸ”’
The longest answer read to see why it refused: the answers of these routes are a line of JSON.
MAX_KEYS πŸ”’
Source-and-reason pairs remembered; a peer that makes up reasons cannot grow the table.
MAX_TEXT_CHARS πŸ”’
What a reason or stage keeps of the text it was made from.
WATCHED πŸ”’
The routes watched, and how long each may go unanswered before a line says so. A file transfer streams for as long as its files take, so its wait is far longer than a jekt’s.

StaticsΒ§

LIMITS πŸ”’
REFUSED πŸ”’
TIMED_OUT πŸ”’
UNANSWERED πŸ”’
WATCH πŸ”’

FunctionsΒ§

acting πŸ”’
during β€œactor check”, for a request that claims to come from agent.
carry πŸ”’
fut, run in the watched request this is called from, if any: a task spawned for the request otherwise would lose it and its stages would go unseen.
claimed πŸ”’
The agent the request says it comes from, unproven. Does nothing outside a watched request.
classify πŸ”’
Why status and the JSON body an answer carried say the request was refused or timed out, if they do. The routes answer a refusal as 200 with success: false (a jekt) or status: "refused" (a remote operation), so the status alone does not tell.
clean πŸ”’
text as one short line a log can carry: printable ASCII and a few separators, the rest an underscore, cut at MAX_TEXT_CHARS.
counts πŸ”’
What App health reports: requests of each kind since this srv started, counted before the line limit.
during πŸ”’
fut, run with the request marked as being at name: the check or wait it is in.
judge πŸ”’
The answer, unchanged, and why it says refused or timed out, if it does. Its body is read when it is a small JSON one, and put back.
lock πŸ”’
report πŸ”’
Count it, and write its line unless one for the same source and reason was written lately.
stage πŸ”’
The request being handled is at name: the check or wait it is in (the last one entered, so a refusal later on can still name an earlier one). Does nothing outside a watched request.
timed_out πŸ”’
refusal, after noting that the handler gave up waiting: the line says timed out, not refused.
watch πŸ”’
Watches a request to one of WATCHED: a line when it is refused, unanswered after the route’s wait, or its handler timed out. Outside every other layer, so an authentication refusal is seen too.
watched πŸ”’