Design 08 sign-in-page: the watcher's health is its unit's state (C-2c)
An exec check runs only through the container runtime, so the watcher, a process, is judged by its unit on the machine, and exits when it cannot subscribe again so the unit shows it.
This commit is contained in:
@@ -117,7 +117,7 @@ L-2. The fact `private-interface` renders the literal `mesh0`. Quick, not thorou
|
||||
Lead answers to code review round 1 of the milestone sign-in-page (fix-1981@g14, 2026-11-24). Each names what settles it.
|
||||
|
||||
C-1 (grants: membership). The tool runner's membership lists the held seat's own-node machine event too (onMachine), so its runtime's mayPublish lets it publish; tests on node-uplink's sign-in-asked.<node> subject itself, and the whole test publishes through the runtime's check, not straight to the stream. Principle: evidence over assertion; §4a.
|
||||
~~C-2 (validator: a tool check alone). networkmanager's service resource (NetworkManager's unit) carries health of kind unit, so the watcher's tool check stands beside a check of another kind (ADR 0227 rule 8, ADR 0240 rule 2), as zfs's process watch stands beside its units' unit checks (read in mesh-catalog main, modules/zfs). §27 changes from "the service resource as it is today" to that.~~ *Corrected by C-2b (2026-11-24).*
|
||||
~~C-2 (validator: a tool check alone). networkmanager's service resource (NetworkManager's unit) carries health of kind unit, so the watcher's tool check stands beside a check of another kind (ADR 0227 rule 8, ADR 0240 rule 2), as zfs's process watch stands beside its units' unit checks (read in mesh-catalog main, modules/zfs). §27 changes from "the service resource as it is today" to that.~~ *Corrected by C-2c (2026-11-24): NetworkManager.service keeps no state and no health (ADR 0117 §4, §5).*
|
||||
C-3 (mesh-sdk test copies). Copy the three definitions byte for byte from mesh-networking and mesh-contracts at their heads, and fix the two tests' decision text to match. Principle: a copy is a copy.
|
||||
C-4 (guard: names in place). The guard judges "in place" from the domains resolved holds on the link now (rawDomainsOf), not from its applied record alone, and sets them again when they are missing; a test where the network manager rewrites the link's domains and one where resolved restarts. §7.
|
||||
C-5 (i3: the opener's bound). cmd/i3-tools runs the opener with its own run that stops waiting at 10 s without killing the opener (DMC-8); a test with an opener that outlives the bound and keeps running.
|
||||
@@ -126,4 +126,6 @@ C-7 (/var/lib/node-resolver unknown). It stays: mesh-catalog's checks/owned refu
|
||||
C-8 (bounds). The watcher socket's 5 s and the names file write's 15 s are stated constants in the design lines, as R2-7 holds for 60 s, 10 s and 256. Principle: a bound is stated; a setting only where machines differ.
|
||||
NOTES taken: (a) node-resolver's real definition adds outside_writes to routes' answer, which systemd-resolved answers today (U-M3: every existing field carries over); (b) a refused open writes a hand-act too (DQ-7: each call); (c) fallback.json's since is the time of the guard's first round, never zero; (d) the watcher redials the system bus only on the socket's file event and on rating-again, never in a loop. mesh-catalog-connectivity's stale generated files on trunk stay a finding outside the milestone.
|
||||
|
||||
C-2b (corrects C-2). NetworkManager.service keeps no state and no health (ADR 0117 §4, §5: the mesh never starts, stops, enables or disables it; a unit check on a service not stated running is refused, ADR 0240 rule 1). The sign-in process's health is of kind exec, command `./uplink-tools health`, which asks the watcher's socket and exits non-zero when the watcher is not subscribed or the last uplink-names call stands failed (60s, 20s, 2 looks, 60s grace); with no tool check left, ADR 0227 rule 8 does not apply, and the check runs on the machine, so it works behind a sign-in page (ADR 0689). `uplink_health` stays a tool of the bundle, not a health check.
|
||||
~~C-2b (corrects C-2). NetworkManager.service keeps no state and no health (ADR 0117 §4, §5: the mesh never starts, stops, enables or disables it; a unit check on a service not stated running is refused, ADR 0240 rule 1). The sign-in process's health is of kind exec, command `./uplink-tools health`, which asks the watcher's socket and exits non-zero when the watcher is not subscribed or the last uplink-names call stands failed (60s, 20s, 2 looks, 60s grace); with no tool check left, ADR 0227 rule 8 does not apply, and the check runs on the machine, so it works behind a sign-in page (ADR 0689). `uplink_health` stays a tool of the bundle, not a health check.~~ *Corrected by C-2c (2026-11-24): an exec check exists only for a container; the manifest validator refuses it on a process, and the node-engine runs exec checks only through the container runtime (the node-engine's `internal/apply/apply.go` `runtimeCheckArgs`, `internal/liveness/readiness.go`).*
|
||||
|
||||
C-2c (corrects C-2 and C-2b). NetworkManager.service keeps no state and no health (ADR 0117 §4, §5); the sign-in process's health is of kind unit (its unit `networkmanager-sign-in` active), judged on the machine without the bus; `uplink_health` stays a tool of the bundle, not a node-engine check, answering not subscribed and a failed uplink-names call, both also in `uplink_sign_in` and the journal; the watcher exits non-zero when it cannot subscribe again after the system bus returns, so its unit shows failing.
|
||||
|
||||
@@ -218,12 +218,10 @@ by nothing (DMC-6).
|
||||
page a bundle never runs; the part that must work without the bus may not need the bus to start. So:
|
||||
- **the watcher** is a process resource of `networkmanager`, as the zfs module's watch is: its `name`
|
||||
`networkmanager-sign-in`, `artifact` `tools`, `run` `./uplink-tools watch`, `user` `${machine:account}`,
|
||||
started by the machine's service manager at boot and kept running, needing no bus; its `health` of kind `exec`,
|
||||
`command` `./uplink-tools health`, `interval` 60s, `timeout` 20s, `looks` 2 and `grace` 60s (C-2b). The command
|
||||
asks the watcher's socket (§12) and reads `names.json`, and exits non-zero, naming which, when the socket does
|
||||
not answer, when the watcher is not subscribed or when the last `uplink-names` call stands failed; `no holder`
|
||||
is healthy. It runs on the machine, so the check works behind a sign-in page (ADR 0689); with no tool check,
|
||||
ADR 0227 rule 8 does not apply. It
|
||||
started by the machine's service manager at boot and kept running, needing no bus; its `health` of kind `unit`:
|
||||
its unit `networkmanager-sign-in` active, judged on the machine without the bus, so it holds behind a sign-in
|
||||
page (ADR 0689; C-2c). The watcher exits non-zero when it cannot subscribe again after the system bus returns
|
||||
(§14), so its unit shows failing. It
|
||||
watches the rating (§14), opens the page and tells the person (§15 to §19), and keeps the events (§20, §21).
|
||||
- **the bundle** `uplink-tools`, in the tool runner once it reaches the bus, as today: it answers `resolvers` and
|
||||
`links`, serves the tools (§23), publishes the kept events (§20) and calls `uplink-names`
|
||||
@@ -271,8 +269,8 @@ by nothing (DMC-6).
|
||||
prepare's check): the node-engine says no `running` for a module restarted in place at the same build, so a
|
||||
restarted resolver gets no new call: it needs none, since the names file holds across its restart (§6) and the
|
||||
guard sets them again from what resolved holds (§7, C-4). One more moment is added, with no new node-engine event
|
||||
in this milestone: the bus connection coming back. (The health look the prepare's answer added here is gone with C-2b: the
|
||||
health check runs on the machine and calls nothing on the bus.) **The bus
|
||||
in this milestone: the bus connection coming back. (The health look the prepare's answer added here is gone with
|
||||
C-2c: the node-engine's check of the watcher is its unit's state, and calls nothing on the bus.) **The bus
|
||||
connection coming back** is the first heartbeat of its consumer answered after a missed one (mesh-sdk's
|
||||
`OnHeartbeat` and `Missed`; DMC-4). **`no holder`** is read from `mesh-module-assigner.assignments` (its node,
|
||||
`seats`) naming no holder of `node-resolver` on its node, never from the bus's no-responders text (DQ-8).
|
||||
@@ -282,7 +280,9 @@ by nothing (DMC-6).
|
||||
sends; nothing runs on a timer, and the check itself stays the network manager's. When its system bus connection
|
||||
drops, it writes that to its journal and subscribes again when the system bus's socket comes back (a file event
|
||||
of the kernel on the socket's folder), then reads the rating and acts on it as on a change; `rating-again` (§12)
|
||||
does the same at once. It redials the system bus only at those two, never in a loop (note d). It runs as `${machine:account}`, which on a machine with a graphical session is the
|
||||
does the same at once. It redials the system bus only at those two, never in a loop (note d). When it cannot
|
||||
subscribe again after the system bus returns, it writes the reason to its journal and exits non-zero, so its unit
|
||||
shows failing and the machine's service manager restarts it (C-2c). It runs as `${machine:account}`, which on a machine with a graphical session is the
|
||||
person's (ADR 0689 §1).
|
||||
15. **It opens the page and tells the person, at three moments** (ADR 0689 §1, §4). With the check on: when the
|
||||
rating becomes PORTAL on the active connection; at its own start when the rating already is PORTAL; and when the
|
||||
@@ -364,15 +364,16 @@ by nothing (DMC-6).
|
||||
- `uplink_names_again` (acts): calls `uplink-names` now as §13 does.
|
||||
- `uplink_rating_again` (acts): asks the watcher `rating-again` (§12).
|
||||
- `uplink_publish_again` (acts): publishes the kept events in `pending/` now, as §20 does (R3-5).
|
||||
- `uplink_health` (reads; a tool of the bundle, not a health check, C-2b): unhealthy while the watcher's socket does not answer, while the
|
||||
watcher is not subscribed, or while the last `uplink-names` call stands failed, naming which; `no holder` is
|
||||
healthy.
|
||||
- `uplink_health` (reads; a tool of the bundle, not a node-engine check, C-2c): unhealthy while the watcher's
|
||||
socket does not answer, while the watcher is not subscribed, or while the last `uplink-names` call stands
|
||||
failed, naming which; `no holder` is healthy. The watcher not subscribed and a failed `uplink-names` call are
|
||||
also shown by `uplink_sign_in` and written to the journal.
|
||||
24. **Its README**, written whole in this milestone (DMC-7), says the two parts and their shared folder, that the watcher opens the page and tells the person on
|
||||
its own machine without the bus, how it finds the session (§16, §17), that it keeps and the bundle publishes the
|
||||
two events from the network manager's own rating, that with the check switched off it neither opens nor keeps,
|
||||
and that the bundle calls `uplink-names` where a holder of `node-resolver` runs (ADR 0687 §2, §3; ADR 0689); and
|
||||
that the watcher's health is checked on the machine by `./uplink-tools health`, which needs no bus (C-2b,
|
||||
replacing R3-4's line); and that the watcher leaves a path in its folder it does not know as it is and writes it to its
|
||||
that the watcher's health is its unit's state, judged on the machine without the bus, and that `uplink_health`
|
||||
is a tool, not a health check (C-2c, replacing R3-4's line); and that the watcher leaves a path in its folder it does not know as it is and writes it to its
|
||||
journal once per path (§12; L-1). Its review reads it.
|
||||
25. **Its tests** (ADR 0687 and ADR 0689, *How it is checked*), unit, with the network manager's D-Bus signals,
|
||||
logind, the user manager, the opener and the notification service stood in, and no bus: PORTAL at a join opens
|
||||
@@ -385,9 +386,9 @@ by nothing (DMC-6).
|
||||
`rating-again`; past 256 kept events the oldest is dropped with a journal line; the bundle publishes the kept
|
||||
events in order with their message ids and deletes each on acknowledgement, keeps a refused one and publishes it
|
||||
at the next moment; `uplink-names` called at the bundle's start, on a changed `check-address`, when the bus
|
||||
connection comes back and on a running holder of `node-resolver`, `no holder` recorded as healthy; `./uplink-tools
|
||||
health` exits non-zero for a socket that does not answer, a watcher not subscribed and a failed `uplink-names`
|
||||
call, and zero for `no holder`, with no bus (C-2b); a watcher restarted after its
|
||||
connection comes back and on a running holder of `node-resolver`, `no holder` recorded as healthy; `uplink_health`
|
||||
unhealthy for a socket that does not answer, a watcher not subscribed and a failed `uplink-names` call, healthy
|
||||
for `no holder`; the watcher exits non-zero when it cannot subscribe again after the system bus returns (C-2c); a watcher restarted after its
|
||||
events were published and `pending/` emptied makes message ids it has not used before, and the bus keeps them
|
||||
(R3-1); `uplink_publish_again` publishes what waits (R3-5); a path in the folder of §12 it does not know is left as
|
||||
it is and written to the journal once (L-1); each tool. **One integration
|
||||
@@ -400,7 +401,7 @@ by nothing (DMC-6).
|
||||
five tools of §23 under `tools` (DMC-5), and keeps its claim of `node-uplink`, its package, its configuration file
|
||||
and its service resource as today: `NetworkManager.service` keeps no state and no health, since the mesh never
|
||||
starts, stops, enables or disables it (ADR 0117 §4, §5) and a unit check on a service not stated running is
|
||||
refused (ADR 0240 rule 1; C-2b, correcting C-2). The prepare
|
||||
refused (ADR 0240 rule 1; C-2c, correcting C-2 and C-2b). The prepare
|
||||
confirms, on each machine that runs `networkmanager`, that the tool runner runs as the same account as the
|
||||
watcher, `${machine:account}`, since the folder of §12 is that account's alone (mode 0700), and writes it in the
|
||||
milestone file (R3-6).
|
||||
|
||||
Reference in New Issue
Block a user