Richard Oudkerk <shibt...@gmail.com> added the comment:

It is not clear to me how to reproduce the bug.

When you say "letting the workers terminate themselves" do mean calling 
sys.exit() or os._exit() in the submitted task?  Are you trying to get the 
result of a task which caused the worker to exit?

I'm not sure how the patch would change the current behaviour.

The following seems to work for me:

import sys, os
import multiprocessing as mp

if __name__ == '__main__':
    p = mp.Pool(4, maxtasksperchild=5)
    results = []

    for i in range(100):
        if i % 10 == 0:
            results.append(p.apply_async(sys.exit))
        else:
            results.append(p.apply_async(os.getpid))

    for i, res in enumerate(results):
        if i % 10 != 0:
            print(res.get())
        else:
            pass      # trying res.get() would block forever

----------

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

Reply via email to