[issue40444] multiprocessing.Pool deadlocks with only print statements

2020-04-30 Thread Ned Deily


Change by Ned Deily :


--
nosy: +davin, pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40444] multiprocessing.Pool deadlocks with only print statements

2020-04-29 Thread Darin Tay


Darin Tay  added the comment:

Ah yes, I should have mentioned this is on Linux!  I also got around to testing 
on 3.8.2 (linux), where it still reproduces.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40444] multiprocessing.Pool deadlocks with only print statements

2020-04-29 Thread Tim Peters


Tim Peters  added the comment:

Just noting that the program runs to completion without issues under 3.8.1, but 
on Win10.  Of course Windows doesn't support fork().

--
nosy: +tim.peters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40444] multiprocessing.Pool deadlocks with only print statements

2020-04-29 Thread Darin Tay


New submission from Darin Tay :

I ran into a deadlock that I've reduced to a small and consistent repro, tested 
on 3.7.5 and 3.8.0.


Reading through https://bugs.python.org/issue6721 now I suspect it is just 
another case of that, but not certain.


In particular, I'm not using any explicit threads, though presumably 
multiprocessing.Pool is using one under-the-hood.  If so, it seems a bit rough 
that multiprocessing can by itself cause the fork issues it tries to warn about 
("Note that safely forking a multithreaded process is problematic.")



# This very quickly and consistently hangs after a few attempts on my machines
def run(x):
print("Worker with ", x)
return x

def main():
for i in range(1000):
print("Attempt #", i)
from multiprocessing import Pool

with Pool(processes=16, maxtasksperchild=1) as p:
for entry in p.imap_unordered(run, range(50)):
print("Main received back ", entry)


if __name__ == "__main__":
main()

--
components: Library (Lib)
messages: 367712
nosy: DarinTay
priority: normal
severity: normal
status: open
title: multiprocessing.Pool deadlocks with only print statements
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com