Skip to content

Commit

Permalink
make eval cancelation async with Eval.Ack (#15294)
Browse files Browse the repository at this point in the history
In #14621 we added an eval canelation reaper goroutine with a channel that
allowed us to wake it up. But we forgot to actually send on this channel from
`Eval.Ack` and are still committing the cancelations synchronously. Fix this by
sending on the buffered channel to wake up the reaper instead.
  • Loading branch information
tgross committed Nov 17, 2022
1 parent 6eb1f99 commit eb1507c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions nomad/eval_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,9 @@ func (e *Eval) Ack(args *structs.EvalAckRequest,
return err
}

// It's not necessary to cancel evals before Ack returns, but it's done here
// to commit canceled evals as close to the Ack'd eval being committed as
// possible.
return cancelCancelableEvals(e.srv)
// Wake up the eval cancelation reaper
e.srv.reapCancelableEvalsCh <- struct{}{}
return nil
}

// Nack is used to negative acknowledge completion of a dequeued evaluation.
Expand Down

0 comments on commit eb1507c

Please sign in to comment.