mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
state: nil-check waiting evals before attempting to cancel them (#26872)
When we attempt to drop unneeded evals from the eval broker, if the eval has been GC'd before the check is made, we hit a nil pointer. Check that the eval actually exists before attempting to remove it from the broker. Fixes: https://github.com/hashicorp/nomad/issues/26871
This commit is contained in:
3
.changelog/26872.txt
Normal file
3
.changelog/26872.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
state: Fixed a bug where the server could panic when attempting to remove unneeded evals from the eval broker
|
||||
```
|
||||
@@ -1034,7 +1034,7 @@ func (n *nomadFSM) applyAllocClientUpdate(msgType structs.MessageType, buf []byt
|
||||
"eval_id", evalID, "error", err)
|
||||
return err
|
||||
}
|
||||
if !eval.ShouldEnqueue() {
|
||||
if eval != nil && !eval.ShouldEnqueue() {
|
||||
n.evalBroker.DropWaiting(eval)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user