-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add support/option to pick TaskProcess
worker process context
#3212
Comments
According to the python docs, it seems you can run https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods Thx for spending the time debugging this hairy issue and sharing it. |
@lallea thanks for the doc link! I guess 1st step in this issue could be to validate that luigi on linux supports alternative multiprocessing start method. I hope it does out of the box 🤞 |
Dummy version of that fails with:
A bit more forceful way: multiprocessing.set_start_method("spawn", force=True) Works. This would still require, that you import the module with this override before workers are created (probably all task files), not sure if that is going to handle all cases 🤷♂️ In the meantime, looks like python might actually switch the defaults in multiprocessing to universal |
Given the comment above I would still be in favor of adding a parameter to control this in luigi. That said it is not a blocker for us right now, and we do not plan to work on this in the near future. If anyone is interested in picking this up, it's up for grabs. Also if maintainers do not feel this issue is worth keeping around - please close. |
Currently
TaskProcess
uses the defaultmultiprocessing
context (inherits frommultiprocessing.Process
), which ends up beingspawn
on mac/windows andfork
on linux. There's no way to change the context on Linux tospawn
orforkserver
if the defaultfork
is causing issues in the worker process (see python/cpython#84559).The text was updated successfully, but these errors were encountered: