Skip to main content

Module upgrade_watch

Module upgrade_watch 

Source
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.upgrade this 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.upgrade with status, in phase, for the release version.
read_version 🔒
One read of app.version: whether the machine now runs version.
register 🔒
register_in 🔒
Start following w in set: false when it already is, or when max are.
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.upgrade starts, if it is the answer to filing a request: not a read of one (status), and requested with the request’s id.
why_words 🔒