Skip to content

Commit

Permalink
controlplane: Add error message when hearbeat fail
Browse files Browse the repository at this point in the history
Signed-off-by: Kfir Toledo <[email protected]>
  • Loading branch information
kfirtoledo committed Jun 13, 2024
1 parent c8bb93e commit 71131d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controlplane/control/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ func (m *peerMonitor) Start() {
break
}

heartbeatOK := m.getClient().GetHeartbeat() == nil
heartbeatErr := m.getClient().GetHeartbeat()
heartbeatOK := heartbeatErr == nil
if healthy == heartbeatOK {
if !healthy {
ticker.Reset(unhealthyInterval)
Expand All @@ -138,6 +139,8 @@ func (m *peerMonitor) Start() {
if strikeCount < threshold {
<-ticker.C
continue
} else if heartbeatErr != nil {
m.logger.Errorf("Failed to send heartbeat to %s : %v", m.pr.Name, heartbeatErr)
}

m.logger.Infof("Peer reachable status changed to: %v", heartbeatOK)
Expand Down

0 comments on commit 71131d3

Please sign in to comment.