networkmanager: the watcher's health is its unit's state
The sign-in process is judged by its unit being active, on the machine without the bus, and NetworkManager's service keeps no state and no health again. The watcher exits non-zero when it cannot subscribe once the system bus came back, so its unit shows failing; uplink_health stays a tool that reads and no longer gives the names again. Builds: design 08 sign-in-page §11, §13, §14, §23, §24, §25, §27; lead answer C-2c (hq 6752a5cf)
This commit is contained in:
@@ -5,7 +5,6 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"git.novox.be/novox/mesh-networking/modules/mesh-connectivity-contracts/go/seats/noderesolver"
|
||||
@@ -53,10 +52,10 @@ func (b *bundle) tools() []stdio.Tool {
|
||||
"its moments: answers how many were published and how many still wait. (a)",
|
||||
Run: func(map[string]any) (any, error) { return b.pub.publishKept("uplink_publish_again"), nil }},
|
||||
{Name: "uplink_health",
|
||||
Description: "Whether the sign-in reaction works, as the watcher process's health check (novox/hq ADR 0240): " +
|
||||
"unhealthy while the watcher's socket does not answer, while the watcher is not subscribed on the system " +
|
||||
"bus, or while the last uplink-names call stands failed, naming which; no holder of node-resolver is " +
|
||||
"healthy. Where a holder runs and the resolver no longer holds the names last given, it gives them again. (r)",
|
||||
Description: "Whether the sign-in reaction works: unhealthy while the watcher's socket does not answer, while " +
|
||||
"the watcher is not subscribed on the system bus, or while the last uplink-names call stands failed, naming " +
|
||||
"which; no holder of node-resolver is healthy. A tool to read, not the watcher's health check, which is its " +
|
||||
"unit's state. (r)",
|
||||
Run: func(map[string]any) (any, error) { return b.health(), nil }},
|
||||
}
|
||||
}
|
||||
@@ -100,8 +99,7 @@ func (b *bundle) resolverRoutes() (noderesolver.RoutesAnswer, bool, error) {
|
||||
return routes, true, err
|
||||
}
|
||||
|
||||
// health is the watcher process's health, as its health tool answers it (§23). At this look, where a holder of
|
||||
// node-resolver runs and its routes no longer hold the names last given, the names are given again (§13).
|
||||
// health is uplink_health's answer, a tool of the bundle and not a node-engine check (§23; lead answer C-2c).
|
||||
func (b *bundle) health() health.Answer {
|
||||
var faults []string
|
||||
var s watcherState
|
||||
@@ -114,13 +112,6 @@ func (b *bundle) health() health.Answer {
|
||||
if err != nil {
|
||||
faults = append(faults, "names.json does not read: "+err.Error())
|
||||
}
|
||||
if call != nil && !call.Failed() && len(call.Names) > 0 {
|
||||
if routes, held, err := b.resolverRoutes(); err == nil && held && !containsAll(routes.UplinkNames.Names, call.Names) {
|
||||
journal("the resolver no longer holds %v: giving them again", call.Names)
|
||||
given := b.names.give("the health look")
|
||||
call = &given
|
||||
}
|
||||
}
|
||||
if call != nil && call.Failed() {
|
||||
faults = append(faults, "the last uplink-names call failed: "+call.Result)
|
||||
}
|
||||
@@ -133,12 +124,3 @@ func (b *bundle) health() health.Answer {
|
||||
}
|
||||
return health.Healthy(why + ".")
|
||||
}
|
||||
|
||||
func containsAll(have, want []string) bool {
|
||||
for _, w := range want {
|
||||
if !slices.Contains(have, w) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user