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 <1527071838.96.0.682650639539.issue31463@psf.upfronthosting.co.za>
In-reply-to
Content
> 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 test.support.reap_children() and test.support.threading_cleanup() to make sure that tests don't leak threads no child processes. It seems like I missed some tests.

In Lib/test/libregrtest/runtest.py, I added:

def post_test_cleanup():
    support.reap_children()

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?
History
Date User Action Args
2018-05-23 10:37:19vstinnersetrecipients: + vstinner, pitrou, benjamin.peterson, hroncok
2018-05-23 10:37:18vstinnersetmessageid: <1527071838.96.0.682650639539.issue31463@psf.upfronthosting.co.za>
2018-05-23 10:37:18vstinnerlinkissue31463 messages
2018-05-23 10:37:18vstinnercreate