Skip to content

Commit

Permalink
this is a write, not a read
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Feb 9, 2023
1 parent e462084 commit f57c841
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nomad/eval_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,8 @@ func (b *EvalBroker) Stats() *BrokerStats {
// stale and ready to mark for canceling. The eval RPC will call this with a
// batch size set to avoid sending overly large raft messages.
func (b *EvalBroker) Cancelable(batchSize int) []*structs.Evaluation {
b.l.RLock()
defer b.l.RUnlock()
b.l.Lock()
defer b.l.Unlock()

if batchSize > len(b.cancelable) {
batchSize = len(b.cancelable)
Expand Down
4 changes: 2 additions & 2 deletions nomad/eval_broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ func TestEvalBroker_IntegrationTest(t *testing.T) {

config := DefaultConfig()
config.NumSchedulers = 2
config.EvalReapCancelableInterval = 500 * time.Millisecond
config.EvalReapCancelableInterval = time.Second
must.NoError(t, srv.Reload(config))

// assert that all but 2 evals were canceled and that the eval broker state
Expand All @@ -1579,7 +1579,7 @@ func TestEvalBroker_IntegrationTest(t *testing.T) {

must.Wait(t, wait.InitialSuccess(
wait.Timeout(10*time.Second),
wait.Gap(50*time.Millisecond),
wait.Gap(100*time.Millisecond),
wait.BoolFunc(func() bool {
got = getEvalStatuses()
return got[structs.EvalStatusComplete] == 2 &&
Expand Down

0 comments on commit f57c841

Please sign in to comment.