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

Multiprocessing Start Method Forced to Forkserver #8306

Closed
TheSkyentist opened this issue Feb 23, 2024 · 1 comment · Fixed by #8343
Closed

Multiprocessing Start Method Forced to Forkserver #8306

TheSkyentist opened this issue Feb 23, 2024 · 1 comment · Fixed by #8343

Comments

@TheSkyentist
Copy link

#8093 Forces the multiprocessing start method globally:

multiprocessing.set_start_method('forkserver', force=True)
multiprocessing.set_start_method('forkserver', force=True)

This can cause weird/unexpected behavior on Linux systems (default method fork) vs macOS (default method spawn). Therefore, even if the JWST pipeline is simply imported, it can change the behaviour of unrelated code that wraps the pipeline (this has been my experience). In general, the best practices recommended by Python are to only call the set_start_method within an if __name__ == '__main__' clause.

This may even effect other modules where multiprocessing is called (e.g. wfss_contam) and cause unexpected behaviour. I'm not sure what the best solution is moving forward, but it should be at least reflected in the documentation that this is required under the hood and may explain errors/problems.

@braingram
Copy link
Collaborator

Thanks for opening this issue. I'm taking a look at it now. I believe the issue will need to be addressed in a dependency (stcal) and then we should be able to remove the above mentioned lines and update wfss_contam.

Also, thanks for the detailed write-up!

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 a pull request may close this issue.

2 participants