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 vstinner
Recipients benjamin.peterson, hroncok, pitrou, vstinner
Date 2018-05-23.10:37:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> It looks like test_multiprocessing_fork doesn't clean up some of its subprocesses and then test_subprocess hangs on waitpid(0) forever.

Oh strange. This issue was supposed to be fixed. I spent a lot of time to fix such bug, but also make sure that not test leak any child process.

"test_subprocess hangs on waitpid(0) forever" I recall a similar bug that I fixed recently.

I spent time on and to make sure that tests don't leak threads no child processes. It seems like I missed some tests.

In Lib/test/libregrtest/, I added:

def post_test_cleanup():

which is run after each test.

But currently, support.reap_children() calls os.waitpid(-1, os.WNOHANG) to check for child processes which already completed. It doesn't warn if there are child processes which are still running.

During my tests, I modified reap_children() to add a sleep(1).

Maybe on Linux we could use a cgroup to really check for all child processes?
Date User Action Args
2018-05-23 10:37:19vstinnersetrecipients: + vstinner, pitrou, benjamin.peterson, hroncok
2018-05-23 10:37:18vstinnersetmessageid: <>
2018-05-23 10:37:18vstinnerlinkissue31463 messages
2018-05-23 10:37:18vstinnercreate