Skip to content

Commit

Permalink
Fixed #3595 (#3595)
Browse files Browse the repository at this point in the history
Stopping heartbeat timer before remove
  • Loading branch information
capone212 committed May 24, 2018
1 parent ee5acd3 commit aa2dc83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nomad/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ func (s *Server) invalidateHeartbeat(id string) {
defer metrics.MeasureSince([]string{"nomad", "heartbeat", "invalidate"}, time.Now())
// Clear the heartbeat timer
s.heartbeatTimersLock.Lock()
delete(s.heartbeatTimers, id)
if timer, ok := s.heartbeatTimers[id]; ok {
timer.Stop()
delete(s.heartbeatTimers, id)
}
s.heartbeatTimersLock.Unlock()

// Do not invalidate the node since we are not the leader. This check avoids
Expand Down

0 comments on commit aa2dc83

Please sign in to comment.