[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

Pablo Galindo Salgado report at bugs.python.org
Sun Dec 9 12:40:27 EST 2018


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I am playing with passing weakreferences into the iterator objects, but this may not be enough. For example, take the code of ApplyResult.get:

def get(self, timeout=None):
    if self._pool() is None:
        raise RuntimeError("The pool is dead!") <--- new code
    self.wait(timeout)

It can be that the pool is alive when we check for it (self._pool() is None) but while the code is waiting with no timeout, the pool dies, effectively leaving the program deadlocked with no error.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35378>
_______________________________________


More information about the Python-bugs-list mailing list