Expand description
Telling an agent how the upgrade it asked another machine for ended.
An agent that files app.upgrade on another machine gets the request’s id and no more: the person
there may veto the countdown, the restart may not be confirmed, the release may not verify, or the
machine may restart into the new version, and until now the agent learned that only by asking again.
This module reads how the request stands for it and tells it once, as an [AgentMux] system note,
never as a message from an agent.
It reads, it is not told. The other machine has no way to speak as one of this machine’s agents, and
nothing here gives it one: this srv holds the requesting agent’s LAN key and asks app.upgrade with
status and app.version for it, the same two reads the agent can make itself. So the other machine
can say nothing the requester could not have asked, and the note is built here from words this file
knows, with the machine’s own text left out.
The note goes only to the agent that asked, from the machine it asked, once. An agent that is not running is tried again at each read until it can take it, and the watch ends after a day with nothing said. It is kept in memory: a restart of this srv forgets it, and the agent can still read the status.
Structs§
- Watch 🔒
- One request being followed.
Enums§
- Ended 🔒
- How a request on the other machine ended, as far as an agent is told.
- Phase 🔒
- Where a request stands while it has not ended.
- Step 🔒
- What one read of the request’s status says to do next.
Constants§
- GIVE_
UP_ 🔒AFTER - After this the agent is not told at all.
- MAX_
WATCHES 🔒 - Watches at once, so a flood of requests cannot become a flood of reads.
- POLL_
OLD 🔒 - Between reads after the first quarter hour, to the end of the day: each read is an audit row on both machines.
- POLL_
YOUNG 🔒 - Between reads while the request is young: a veto or a restart is a matter of minutes.
- READ_
REASON 🔒 - YOUNG_
FOR 🔒
Statics§
- WATCHING 🔒
Functions§
- clock 🔒
ms(Unix) as “16:33 UTC”.- key 🔒
- note_
asked 🔒 - Called with every answer to a remote
app.upgradethis machine’s agents get: follows a request just filed. - note_
for 🔒 - The note: which machine, which release, how it ended and when. Every word is this file’s own, but for the machine’s name and the release, which are quoted like any text a note carries that srv did not write.
- read_
status 🔒 - One read of
app.upgradewithstatus, inphase, for the releaseversion. - read_
version 🔒 - One read of
app.version: whether the machine now runsversion. - register 🔒
- register_
in 🔒 - Start following
winset: false when it already is, or whenmaxare. - run 🔒
- tell 🔒
- Tell
w’s agent: whether it was delivered (an agent that is not running is not an error: it is tried again). - unregister 🔒
- watch_
for 🔒 - The watch an answer to
app.upgradestarts, if it is the answer to filing a request: not a read of one (status), andrequestedwith the request’s id. - why_
words 🔒