This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bstaletic
Recipients YannickJadoul, bstaletic
Date 2021-02-10.11:20:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612956006.24.0.11506183498.issue43145@roundup.psfhosted.org>
In-reply-to
Content
The `multiprocessing.Process`, on Linux, ends up doing something like this:

pid = os.fork()
if pid == 0: os._exit()

Translated to C:

int main() {
    Py_Initialize();
    PyOS_BeforeFork();
    pid_t pid = fork();
    if (pid == 0) {
        PyOS_AfterFork_Child(); // Reinitializes stuff.
        _exit(0); // Child process exits without cleanup.
    }
    PyOS_AfterFork_Parent();
    Py_Finalize();
}

The call to `_exit()` happens in Lib/multiprocessing/popen_fork.py#L73

My attempts at cleaning this up resulted in even more problems.
History
Date User Action Args
2021-02-10 11:20:06bstaleticsetrecipients: + bstaletic, YannickJadoul
2021-02-10 11:20:06bstaleticsetmessageid: <1612956006.24.0.11506183498.issue43145@roundup.psfhosted.org>
2021-02-10 11:20:06bstaleticlinkissue43145 messages
2021-02-10 11:20:06bstaleticcreate