Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: fix panic if heartbeat reset happens for GC'd node #23383

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/23383.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
server: Fixed a bug where expiring heartbeats for garbage collected nodes could panic the server
```
4 changes: 4 additions & 0 deletions nomad/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ func (h *nodeHeartbeater) disconnectState(id string) (bool, bool) {
h.logger.Error("error retrieving node by id", "error", err)
return false, false
}
if node == nil {
h.logger.Error("node not found", "node_id", id)
return false, false
}

// Exit if the node is already down or just initializing.
if node.Status == structs.NodeStatusDown || node.Status == structs.NodeStatusInit {
Expand Down
Loading