Repository navigation
A long-occupancy job class for the blocking pool #74
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Serialize the tests that assert on process-global pool statistics.
pool_stats()reports the shared pool, as the comment on Line 373 states. Cargo runs the tests of one binary on parallel threads. Both new tests are registered in the same binary incrates/turnloop-contract/src/lib.rsand incrates/turnloop-contract/tests/windows.rs.Two concrete conflicts follow:
occupancy_classes_do_not_starve_each_otherholdspool.threads * 8long workers busy. During that windowlong_jobs_settle_once_on_cancel_panic_and_shutdownwaits at Line 604 forpool_stats().long_busy == 0, which cannot become true. The 30-second deadline then fails the test.shared_pool, makes the absolute assertions at Lines 411-413 fail.The panic-hook swap at Lines 546-556 is the same class of shared process state and races with other tests in the binary.
Guard both tests with one shared lock so only one of them touches the global pool and the panic hook at a time.
🔒 Proposed fix: a shared test lock
pub fn long_jobs_settle_once_on_cancel_panic_and_shutdown<B: Backend>() { + let _guard = POOL_STATS_LOCK.lock().unwrap_or_else(|e| e.into_inner()); let mut l = Driver::<B>::new(Config::default()).expect("loop");Also applies to: 403-414, 604-606
🤖 Prompt for AI Agents