Message364259
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 |
|
Date |
User |
Action |
Args |
2020-03-15 20:48:55 | arekm | set | recipients:
+ arekm, vstinner, pablogsal, gaborjbernat, BTaskaya |
2020-03-15 20:48:55 | arekm | set | messageid: <1584305335.12.0.750834201618.issue39360@roundup.psfhosted.org> |
2020-03-15 20:48:55 | arekm | link | issue39360 messages |
2020-03-15 20:48:54 | arekm | create | |
|