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

eval broker: use write lock when reaping cancelable evals #16112

Merged
merged 1 commit into from
Feb 10, 2023

Commits on Feb 10, 2023

  1. eval broker: use write lock when reaping cancelable evals

    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.
    tgross committed Feb 10, 2023
    Configuration menu
    Copy the full SHA
    d76273d View commit details
    Browse the repository at this point in the history