mirror of
https://github.com/kemko/nomad.git
synced 2026-01-11 04:45:42 +03:00
nomad: document some potential races
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user