From 8f3106d2bc53dcbcf34f8cd234f25a94e15034b6 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 17 Nov 2022 15:44:51 -0500 Subject: [PATCH] make eval cancelation async with `Eval.Ack` 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. --- nomad/eval_endpoint.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nomad/eval_endpoint.go b/nomad/eval_endpoint.go index 0413ebc4f5be..88ade7847086 100644 --- a/nomad/eval_endpoint.go +++ b/nomad/eval_endpoint.go @@ -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.