STINNER Victor added the comment:

The problem is that socketserver.ForkinMixin doesn't wait until all children 
completes. It's only calls os.waitpid() in non-blocking module (using 
os.WNOHANG) after each loop iteration. If a child process completes after the 
last call to ForkingMixIn.collect_children(), the server leaks zombie processes.

The server must wait until all children completes. Attached PR implements that.

The bug was be reproduced with the attached forkingmixin_sleep.patch.

haypo@selma$ ./python -m test -v -u all test_socketserver --fail-env-changed -m 
'*Fork*'
(...)
Warning -- reap_children() reaped child process 17093
Warning -- reap_children() reaped child process 17094
(...)

----------
keywords: +patch
Added file: http://bugs.python.org/file47072/forkingmixin_sleep.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31151>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to