The controller no longer subscribes to the alive message: HostBeats, its handler, the heartbeat-gap duration and a fixed silent bound (issue 1183, AC3, AC4, AC5)
mesh/merge-gate head 19e3eac74658 merged into trunk 89cfa9431d8f — pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every …
mesh/repo-check head 19e3eac74658 merged into trunk 89cfa9431d8f — pass: its merge-check.sh passed
mesh/delivery delivered
mesh/merge-gate head 19e3eac74658 merged into trunk 89cfa9431d8f — pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every …
mesh/repo-check head 19e3eac74658 merged into trunk 89cfa9431d8f — pass: its merge-check.sh passed
mesh/delivery delivered
This commit is contained in:
+2
-26
@@ -205,8 +205,8 @@ func (s *Server) Close() {
|
||||
|
||||
// Serve acts on what arrives until the context ends.
|
||||
func (s *Server) Serve(ctx context.Context) error {
|
||||
s.log.Printf("consuming what nodes say: %s, %s, %s, %s",
|
||||
KindEnrolment, KindReport, KindHeartbeat, KindBuilt)
|
||||
s.log.Printf("consuming what nodes say: %s, %s, %s",
|
||||
KindEnrolment, KindReport, KindBuilt)
|
||||
if s.upgrader != nil {
|
||||
s.log.Printf("following %s", KindModuleMoved)
|
||||
}
|
||||
@@ -226,8 +226,6 @@ func (s *Server) act(ctx context.Context, m Control) {
|
||||
s.enrolling(ctx, m)
|
||||
case KindReport:
|
||||
s.reported(ctx, m)
|
||||
case KindHeartbeat:
|
||||
s.heartbeat(m)
|
||||
case KindToolsHeartbeat:
|
||||
s.toolsHeartbeat(m)
|
||||
case KindHealth:
|
||||
@@ -324,28 +322,6 @@ func (s *Server) outstanding(ctx context.Context, node string) string {
|
||||
return digest
|
||||
}
|
||||
|
||||
// heartbeat records that a node was heard from, and nothing else.
|
||||
//
|
||||
// Deliberately silent: a node saying it is there every minute would fill the log with the ordinary
|
||||
// case, and a log where the ordinary case is loud is a log nobody reads. Not held for the store
|
||||
// either — the next heartbeat is a minute away, and a heartbeat kept for two minutes to be written
|
||||
// late says nothing the one after it will not say better.
|
||||
func (s *Server) heartbeat(m Control) {
|
||||
var alive Alive
|
||||
if err := json.Unmarshal(m.Body(), &alive); err != nil || alive.Node == "" {
|
||||
_ = m.Drop()
|
||||
return
|
||||
}
|
||||
// The interval it says, for the watchdog's bound (novox/hq to-be 45 S1).
|
||||
HostBeats.Heard(alive.Node, time.Now(), time.Duration(alive.IntervalSeconds)*time.Second, "")
|
||||
if s.listener != nil {
|
||||
if _, err := s.listener.Heard(context.Background(), Report{Node: alive.Node}); err != nil {
|
||||
s.log.Printf("could not record that %s is here: %v", alive.Node, err)
|
||||
}
|
||||
}
|
||||
_ = m.Took()
|
||||
}
|
||||
|
||||
// toolsHeartbeat records that a machine's node tools were heard from (novox/hq to-be 45 S11), and
|
||||
// nothing else: in this process's memory, for the watchdog — the next one is a minute away.
|
||||
func (s *Server) toolsHeartbeat(m Control) {
|
||||
|
||||
Reference in New Issue
Block a user