MCPcopy
hub / github.com/google/seesaw / reportStatus

Method reportStatus

ha/core.go:435–459  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

433}
434
435func (n *Node) reportStatus() {
436 for {
437 var err error
438 failover := false
439 failures := 0
440 for {
441 failover, err = n.engine.HAUpdate(n.status())
442 if err == nil {
443 break
444 }
445 failures++
446 log.Errorf("reportStatus: %v", err)
447 if failures > n.StatusReportMaxFailures {
448 n.errChannel <- fmt.Errorf("reportStatus: %d errors, giving up", failures)
449 return
450 }
451 time.Sleep(n.StatusReportRetryDelay)
452 }
453 if failover && n.state() == spb.HaState_LEADER {
454 log.Info("Received failover request, initiating shutdown...")
455 n.Shutdown()
456 }
457 time.Sleep(n.StatusReportInterval)
458 }
459}
460
461func (n *Node) checkConfig() {
462 for {

Callers 1

RunMethod · 0.95

Calls 4

statusMethod · 0.95
stateMethod · 0.95
ShutdownMethod · 0.95
HAUpdateMethod · 0.65

Tested by

no test coverage detected