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

Terminate other processes if one breaks #75

Merged
merged 6 commits into from
Jan 10, 2024

Conversation

McHaillet
Copy link
Collaborator

Noticed a multiprocessing problem (unrelated to #74). When one of the processes fails, the other will keep running. This is undesired as the results will become unusable. Now I explicitly terminate all processes when one fails before raise a runtimeerror in the main process.

(I previsouly thought that 'raise RuntimeError' would be propagated to child processes, but that is apparently not the case)

@McHaillet McHaillet requested a review from sroet January 9, 2024 11:09
Copy link
Collaborator

@sroet sroet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, as discussed offline: please add a test that catches this RuntimeError and then checks if there are no processes still in multiprocess.active_children()

@McHaillet
Copy link
Collaborator Author

Not done yet, will let you know when ready ;)

@McHaillet
Copy link
Collaborator Author

Okay, good to go for my part!

I added in a stdout/stderr muting option for spawning processes during unit tests to prevent the terminal showing an error message during the tests. Let me know if you agree with how I did that.

@McHaillet McHaillet requested a review from sroet January 9, 2024 15:13
Copy link
Collaborator

@sroet sroet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple implementation issues, looks good otherwise

Copy link
Collaborator

@sroet sroet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last nitpick for the documentation, LGTM otherwise

@McHaillet
Copy link
Collaborator Author

Thanks for spotting!

Copy link
Collaborator

@sroet sroet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, feel free to merge

@McHaillet McHaillet merged commit 7a27922 into SBC-Utrecht:main Jan 10, 2024
@McHaillet McHaillet deleted the patch-process-break branch January 10, 2024 11:19
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

Successfully merging this pull request may close these issues.

2 participants