nomad: document some potential races

This commit is contained in:
Armon Dadgar
2015-08-15 18:03:05 -07:00
parent 2e6b1cdf95
commit d36d420a71
3 changed files with 6 additions and 0 deletions

View File

@@ -235,6 +235,8 @@ func (c *Client) createNodeEvals(nodeID string, nodeIndex uint64) ([]string, uin
}
// Commit this evaluation via Raft
// XXX: There is a risk of partial failure where the node update succeeds
// but that the EvalUpdate does not.
_, evalIndex, err := c.srv.raftApply(structs.EvalUpdateRequestType, update)
if err != nil {
return nil, 0, err

View File

@@ -67,6 +67,8 @@ func (j *Job) Register(args *structs.JobRegisterRequest, reply *structs.JobRegis
}
// Commit this evaluation via Raft
// XXX: There is a risk of partial failure where the JobRegister succeeds
// but that the EvalUpdate does not.
_, evalIndex, err := j.srv.raftApply(structs.EvalUpdateRequestType, update)
if err != nil {
j.srv.logger.Printf("[ERR] nomad.job: Eval create failed: %v", err)

View File

@@ -154,6 +154,8 @@ func evaluateNodePlan(snap *state.StateSnapshot, plan *structs.Plan, nodeID stri
}
// If the node does not exist or is not ready for schduling it is not fit
// XXX: There is a potential race between when we do this check and when
// the Raft commit happens.
if node == nil || node.Status != structs.NodeStatusReady {
return false, nil
}