Arkadiusz Miśkiewicz <[email protected]> added the comment:
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
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39360>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com