Fix a panic during plan evaluation

This PR fixes a potential source of a panic while evaluating a plan with
all_at_once set to true with partial failures.

Fixes #2531
This commit is contained in:
Alex Dadgar 2017-04-10 14:56:21 -07:00
parent 5fa6a23f01
commit c261fe324e
1 changed files with 2 additions and 1 deletions

View File

@ -263,6 +263,7 @@ func evaluatePlan(pool *EvaluatePool, snap *state.StateSnapshot, plan *structs.P
// Evalute each node in the plan, handling results as they are ready to
// avoid blocking.
OUTER:
for len(nodeIDList) > 0 {
nodeID := nodeIDList[0]
select {
@ -276,7 +277,7 @@ func evaluatePlan(pool *EvaluatePool, snap *state.StateSnapshot, plan *structs.P
// which may save time processing additional entries.
if cancel := handleResult(r.nodeID, r.fit, r.err); cancel {
didCancel = true
break
break OUTER
}
}
}