Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid using internal functions/object with multiprocessing
A Multiprocessing start method is the technique used by the Multiprocessing library to start child processes in Python. There are three start methods: * spawn: start a new Python process. * fork: copy a Python process from an existing process. * forkserver: new process from which future forked processes will be copied. Each OS has a list of supported start methods: * Windows (win32): spawn * MacOS (darwin): spawn (default), fork, forkserver. * Linux (unix): spawn, fork (default), forkserver. Spawn not only is the most supported, but as per recent investigations of the devs of the Multiprocessing library, is the most secure on all the OS. Spawn method makes use of the Pickle library for starting the new subprocesses and Pickle is unable to process internal objects and functions. Get rid an internal function (handler inside the make_logging_handler method of the Command class) and use a callable object instead. Consider substituting internal objects and functions with Pickle compliant options all around the code and eventually enforce the usage of the spawn method. Signed-off-by: Giulio Calacoci <[email protected]>
- Loading branch information