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
Allow for main thread having terminated pid, before ThreadPoolExecutor threads #54017
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
68c29af
Allow for main thread having terminated pid, before ThreadPoolExecuto…
2e3ca43
Updated for review comments
e189177
Removed typos
2d20fbe
Adjusted try/except statements on process checking
406d382
Adjusted for review comments
64d9752
Add warning messages to help determine why pids do not exist
dwoz 9bb9466
Add unit tests for weird pid does not exist cases
dwoz 264c767
Merge pull request #1 from dwoz/fix_deb9_build90_tests
dmurphy18 4ca709e
Merge branch '2019.2.1' into fix_deb9_build90_tests
dmurphy18 5577f14
Clean up lint errors
2866520
Skip process kill tests on Windows
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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
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.
Sorry for not mentioning this earlier, but maybe it's worth adding a try-catch here as well, if any children fail to terminate (due to race-conditions), to still try to terminate the rest of the child (not to stop on the first one that fails). Or maybe it's okay to stop on the first one?
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.
@rares-pop @dmurphy18 I don't think we need this
if psutil.pid_exists(self.pid):
at all. Just let it raise an exception if the parent doesn't exist. However, when iterating through the children I think we should except each one individually in case one goes away but others don't.Maybe move this functionality to a utility method and add some unit tests for it.
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.
@dwoz - that was exactly my feedback too. 👍
The first comment was about the unneeded pid_exists (I mentioned the possible race-condition), and the second about having the try-raise for children.