Judge the machine's own networking beside what its modules run (hq ADR 0241)
A VPN client rewrote the laptop's resolver file and every mesh name failed while each module read healthy: nothing asked the machine. The engine now looks every 30 s at the resolver file the uplink holder declared (naming the program that rewrote it), the names through each listed resolver (NXDOMAIN for a mesh name's IPv6 address is a finding, issue 262), the tunnel's handshake with the hub, the bus and the default route; a part is unhealthy on its second failing look, and the statement carries it.
This commit is contained in:
@@ -238,6 +238,36 @@ type Health struct {
|
||||
At time.Time `json:"at"`
|
||||
// Resources are every long-running resource of a module this machine runs, by module and id.
|
||||
Resources []ResourceHealth `json:"resources"`
|
||||
// Network is the machine's own networking, judged by its engine (novox/hq ADR 0241): its resolver
|
||||
// file, its names, its tunnel, its bus and its route. Absent from an engine older than that judging,
|
||||
// which the controller reads as "not known", never as healthy.
|
||||
Network *NetworkHealth `json:"network,omitempty"`
|
||||
}
|
||||
|
||||
// NetworkHealth is the machine's networking in one statement (ADR 0241): the worst of its parts, since
|
||||
// when, and each part.
|
||||
type NetworkHealth struct {
|
||||
State string `json:"state"`
|
||||
Since time.Time `json:"since"`
|
||||
Parts []NetworkPart `json:"parts"`
|
||||
}
|
||||
|
||||
// NetworkPart is one part of a machine's networking, as its engine judged it on its second look.
|
||||
type NetworkPart struct {
|
||||
// Part is resolv-conf, names, tunnel, bus or route.
|
||||
Part string `json:"part"`
|
||||
State string `json:"state"`
|
||||
// Reason is why it is not healthy, in words with no address, path or domain; Said the detail.
|
||||
Reason string `json:"reason,omitempty"`
|
||||
Said string `json:"said,omitempty"`
|
||||
// Writer is the program that rewrote the resolver file, when it can be named; Owner the module whose
|
||||
// file it is — the uplink's holder.
|
||||
Writer string `json:"writer,omitempty"`
|
||||
Owner string `json:"owner,omitempty"`
|
||||
// Toward is what the failure points at: "hub", or each resolver's address that failed.
|
||||
Toward []string `json:"toward,omitempty"`
|
||||
Since time.Time `json:"since"`
|
||||
Streak int `json:"streak,omitempty"`
|
||||
}
|
||||
|
||||
// The states a long-running resource is said in (ADR 0240 §4).
|
||||
|
||||
@@ -479,6 +479,15 @@ func declaredIn(body []byte) string {
|
||||
return hex.EncodeToString(sum[:])
|
||||
}
|
||||
|
||||
// Linked says whether a link to the bus is open now (novox/hq ADR 0241: the bus is one part of the
|
||||
// machine's networking its engine judges).
|
||||
func (q *Queue) Linked() bool {
|
||||
q.init()
|
||||
q.mu.Lock()
|
||||
defer q.mu.Unlock()
|
||||
return q.bus != nil
|
||||
}
|
||||
|
||||
// SayHealth says a health statement on the link open now (novox/hq ADR 0240, to-be 48 §4), and whether
|
||||
// the bus took it. **Not through the worker**: a statement is a word about the machine as it is, not an
|
||||
// account of an apply, and it must not wait behind one — a container crash-looping while a long apply
|
||||
|
||||
Reference in New Issue
Block a user