From 2b7bdfee378481164915b1ae4d3dd71ac091fb1e Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Mon, 22 Feb 2016 12:15:40 -0800 Subject: [PATCH] nomad: add a sanity check guard --- scheduler/generic_sched.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scheduler/generic_sched.go b/scheduler/generic_sched.go index e6df9a526..3a3db34d8 100644 --- a/scheduler/generic_sched.go +++ b/scheduler/generic_sched.go @@ -216,6 +216,9 @@ func (s *GenericScheduler) process() (bool, error) { if !fullCommit { s.logger.Printf("[DEBUG] sched: %#v: attempted %d placements, %d placed", s.eval, expected, actual) + if newState == nil { + return false, fmt.Errorf("missing state refresh after partial commit") + } return false, nil }