-
Notifications
You must be signed in to change notification settings - Fork 464
Handle BrokenProcessPool with isolated single-process fallback #2404
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
Closed
vreutskyy
wants to merge
6
commits into
newton-physics:main
from
vreutskyy:vreutskyy/fix-broken-process-pool
+148
−9
Closed
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6b8e3ad
Recycle ProcessPoolExecutor workers to fix BrokenProcessPool (#1847)
vreutskyy 0a5e7a6
Handle BrokenProcessPool with isolated single-process fallback (#1847)
vreutskyy 5e358f5
Merge branch 'main' into vreutskyy/fix-broken-process-pool
vreutskyy c53c02c
Merge branch 'main' into vreutskyy/fix-broken-process-pool
vreutskyy 7f0f7ea
Merge branch 'main' into vreutskyy/fix-broken-process-pool
vreutskyy d1dde68
Merge branch 'main' into vreutskyy/fix-broken-process-pool
vreutskyy 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
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.
🧩 Analysis chain
🌐 Web query:
In Python'sconcurrent.futuresdocumentation, doesExecutor.map(timeout=...)apply the timeout per item, or from the originalExecutor.map()call?💡 Result:
Web search failed: Server error: no LLM provider could handle the message
🌐 Web query:
Python concurrent.futures Executor.map timeout semantics per item vs total duration💡 Result:
Executor.map(..., timeout=T)is a single overall deadline, not “T seconds per item”.Executor.map(). The iterator it returns will raiseTimeoutErrorwhen you call__next__()and the next result isn’t ready byTseconds after that originalmap()call. So eachnext()effectively only gets the remaining time until the same global deadline. [1]list()it, etc.), then__next__()is never called and no timeout is triggered. [2]map()yields results in input order, one slow early item can block yielding later items even if they’re already finished. [1]If you want per-item timeouts, use
submit()and thenfuture.result(timeout=...)per future (or manage futures withas_completed()), rather than relying onExecutor.map(timeout=...). [1]Sources: Python docs for
Executor.map()semantics [1]; discussion/example showing timeout only occurs during iteration [2].🏁 Script executed:
Repository: newton-physics/newton
Length of output: 2127
🏁 Script executed:
Repository: newton-physics/newton
Length of output: 741
🏁 Script executed:
Repository: newton-physics/newton
Length of output: 684
The timeout comment and warning message are misleading about the timeout scope.
Line 249's
executor.map(timeout=_SUITE_TIMEOUT)applies a wall-clock deadline to the entire parallel phase (not per-suite), which matches the_SUITE_TIMEOUTcomment "Wall-clock limit for parallel execution". However, the warning message at line 257 states "Next pending result was suite ... but a different suite may be the actual blocker," which is inconsistent with wall-clock timeout semantics—under a global deadline, which suite is slow doesn't matter; the entire parallel phase has exhausted its time budget. If the intent is truly a per-suite wall-clock cap for parallel execution (to match the isolated fallback's per-suite behavior), clarify the code comment and revise the warning message to reflect that. Otherwise, update the warning to remove the misleading reference to specific suites being blockers when the timeout is global.🤖 Prompt for AI Agents