Fix cycle verification "worker stopped" warning #402
Merged
Conversation
…allelized process.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses benign “worker stopped” warnings seen during PNA edge cycle verification by tuning the parallel execution and DuckDB per-worker configuration to reduce worker churn and thread oversubscription.
Changes:
- Limit DuckDB connections created inside parallel workers to a single DuckDB thread (
threads=1). - Configure joblib
Parallelto use thelokybackend with an increased backend timeout to reduce worker-restart warnings during long batches.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+355
to
+361
| # Keep workers alive longer to avoid worker-restart warnings | ||
| # during long component processing batches. | ||
| n_removed_edges_list = Parallel( | ||
| n_jobs=n_threads, | ||
| backend="loky", | ||
| backend_kwargs={"timeout": 1800}, | ||
| )( |
Aratz
approved these changes
Jun 17, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
During edge cycle verification, we get a warning about workers being terminated. This warning is benign and we recover all components, but still we would like to understand and fix the issue.
Update: The issue of workers stopping is resolved by assigning a high timeout value in joblib 'Parallel' initialization. We have also limited the number of threads used in duckdb connections that are initiated by parallelized workers to 1.
Fixes: PNA-2198
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Tried on a few samples to verify that the warning disappears.
PR checklist:
pyproject.tomland cited it properly