[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-04 Thread STINNER Victor
STINNER Victor added the comment: > I'm using `contextlib.closing` Oh, I missed that: good! -- ___ Python tracker ___ ___ Python-b

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-04 Thread Anthony Sottile
Anthony Sottile added the comment: If you see the bottom of my issue, I've suggested (nearly) the same thing -- though I require python2.x compatibility so I'm using `contextlib.closing` -- ___ Python tracker _

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-04 Thread STINNER Victor
STINNER Victor added the comment: I suggest you to write: with multiprocessing.Pool(4) as pool: result = tuple(pool.imap(print, (1, 2, 3))) On Python 3.8, your example will now log a resource warning since you don't close/terminate explicitly the pool. -- nosy: +vstinner _

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Indeed, looks like a duplicate. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects __

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-04 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +pitrou versions: -Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-02 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-02 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I believe that this is similar to https://bugs.python.org/issue35378 on which @pablogsal is working. You were right, the issue steems from a refcount bug. Until the resolution you can avoid the issue by explictly keeping a reference on the pool: >>> import mul

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2018-12-31 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Weirdly enough, it works with iPython: $ ipython3 Python 3.7.1 (default, Nov 6 2018, 18:49:54) Type 'copyright', 'credits' or 'license' for more information IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: import m

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2018-12-31 Thread Anthony Sottile
New submission from Anthony Sottile : This simple program causes a hang / leaked processes (easiest to run in an interactive shell): import multiprocessing tuple(multiprocessing.Pool(4).imap(print, (1, 2, 3))) $ python3.6 Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] on linux Typ