pnpnpn / timeout-decorator

Timeout decorator for Python
MIT License
628 stars 94 forks source link

Exception daemonic processes are not allowed to have children #58

Closed derekleegh closed 5 years ago

derekleegh commented 5 years ago

Hi, I got this issue when deploying the timeout_decorator in celery tasks.

I have set use_signals = False.

The timeout works but will throw this error message. Checked around the internet and its probably due to the multiprocessing library and can be solved using billard.

Do you think you can implement billard library to replace multiprocessing?

bitranox commented 5 years ago

You might look here :

https://stackoverflow.com/questions/6974695/python-process-pool-non-daemonic

and You might give it a try, just by:

import billard as multiprocessing
derekleegh commented 5 years ago

Hi, do you mean on my celery change to use billiard? Or inside the timeout decorator change to use billiard?

bitranox commented 5 years ago

As far as I know celery uses billard already. Just inside the timeout decorator, replace the multiprocessing module with billard. You might also try my decorator - https://github.com/bitranox/wrapt-timeout-decorator it is using "dill" instead of pickle (can pickle more datatypes) and "multiprocess" instead of "multiprocessing"

derekleegh commented 5 years ago

Alright, thanks for the information. Will try it out