Skip to content

Commit

Permalink
Fix concurrency issue in node manager health report (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanliqun authored Sep 20, 2024
1 parent 56bd77b commit e3fdc52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node/manager_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,9 @@ func (m *Manager) ReportHealthy(nodeName string) {
logrus.WithField("node", nodeName).Warn("Node became healthy now")

// add recovered node into hash ring again
m.hashRing.Add(m.nodes[nodeName])
if n, ok := m.Get(nodeName); ok {
m.hashRing.Add(n)
} else { // this should not happen, but just in case
logrus.WithField("node", nodeName).Error("Node not found in manager")
}
}

0 comments on commit e3fdc52

Please sign in to comment.