make eval cancelation async with `Eval.Ack` (#15294)

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.
This commit is contained in:
Tim Gross 2022-11-17 16:40:41 -05:00 committed by GitHub
parent d0f9e887f7
commit b74a868aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -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.