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 arekm
Recipients BTaskaya, arekm, gaborjbernat, pablogsal, vstinner
Date 2020-03-15.20:48:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584305335.12.0.750834201618.issue39360@roundup.psfhosted.org>
In-reply-to
Content
Ok, so two test cases

1)

from multiprocessing.pool import ThreadPool
class A(object):
    def __init__(self):
        self.pool = ThreadPool()
    def __del__(self):
        self.pool.close()
        self.pool.join()
a = A()
print(a)

2)

from multiprocessing import Pool
class A:
    def __init__(self):
        self.pool = Pool(processes=1)
def test():
    problem = A()
    problem.pool.map(float, tuple(range(10)))
if __name__ == "__main__":
    test()

On two my test environments with Linux, 5.5.2 and 4.9.208 kernel, glibc 2.31 (userspace is mostly the same on both) test 1) hangs, 2) doesn't hang.

Testing done on 3.8 branch + https://patch-diff.githubusercontent.com/raw/python/cpython/pull/19023.patch


For test 1) no traceback on ctrl+c and also no trace logged with faulthandler installed, so no idea where it hangt.

strace shows
[...]
[pid 232031] munmap(0x7f1baaffe000, 8392704 <unfinished ...>
[pid 232017] write(5, "\0\0\0\4\200\4N.", 8 <unfinished ...>
[pid 232031] <... munmap resumed>)      = 0
[pid 232017] <... write resumed>)       = 8
[pid 232031] exit(0)                    = ?
[pid 232017] futex(0x7f1b94000b60, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 232031] +++ exited with 0 +++
^C ************************* ctrl + c pressed
[pid 232017] <... futex resumed>)       = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
strace: Process 232017 detached
strace: Process 232032 detached
strace: Process 232033 detached
strace: Process 232034 detached
strace: Process 232035 detached
History
Date User Action Args
2020-03-15 20:48:55arekmsetrecipients: + arekm, vstinner, pablogsal, gaborjbernat, BTaskaya
2020-03-15 20:48:55arekmsetmessageid: <1584305335.12.0.750834201618.issue39360@roundup.psfhosted.org>
2020-03-15 20:48:55arekmlinkissue39360 messages
2020-03-15 20:48:54arekmcreate