Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of eval broker: use write lock when reaping cancelable evals into release/1.4.x #16127

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #16112 to be assessed for backporting due to the inclusion of the label backport/1.4.x.

The below text is copied from the body of the original PR.


The eval broker's Cancelable method used by the cancelable eval reaper mutates
the slice of cancelable evals by removing a batch at a time from the slice. But
this method unsafely uses a read lock despite this mutation. Under normal
workloads this is likely to be safe but when the eval broker is under the heavy
load this feature is intended to fix, we're likely to have a race
condition. Switch this to a write lock, like the other locks that mutate the
eval broker state.

This changeset also adjusts the timeout to allow poorly-sized Actions runners
more time to schedule the appropriate goroutines. The test has also been updated
to use shoenig/test/wait so we can have sensible reporting of the results
rather than just a timeout error when things go wrong.

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/b-flaky-eval-broker-test/subtly-actual-crappie branch 2 times, most recently from 417708d to 2c487fa Compare February 10, 2023 15:41
@hc-github-team-nomad-core hc-github-team-nomad-core merged commit fa4a374 into release/1.4.x Feb 10, 2023
@hc-github-team-nomad-core hc-github-team-nomad-core deleted the backport/b-flaky-eval-broker-test/subtly-actual-crappie branch February 10, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants