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

Run Scheduler#cache_warm on global thread pool instead of Scheduler's thread pool #286

Closed
bensheldon opened this issue Jun 29, 2021 · 1 comment

Comments

@bensheldon
Copy link
Owner

In single-thread queues, it's possible for the warm_cache operation to have a race condition with newly enqueued jobs that result in the job not being immediately executed because the warm_cache operation has exhausted the executor itself.

Instead, warm_cache should be run on the global thread pool. I don't think this will have side effects.

@bensheldon bensheldon changed the title Run Scheduler#cache_warm on global thread pool instead of Scheduler Run Scheduler#cache_warm on global thread pool instead of Scheduler's thread pool Jul 1, 2021
@bensheldon
Copy link
Owner Author

Running on the global thread pool was a bad idea because it's unmanaged. This is a simpler fix:

create_task # If cache-warming exhausts the threads, ensure there isn't an executable task remaining

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

No branches or pull requests

1 participant