homepage

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 vstinner
Recipients neologix, pitrou, vstinner
Date 2011年06月21日.01:05:33
SpamBayes Score 5.9755537e-05
Marked as misclassified No
Message-id <1308618335.51.0.449763650808.issue12364@psf.upfronthosting.co.za>
In-reply-to
Content
Oh, I think that I found a deadlock (or something like that):
----------------------------
import concurrent.futures
import faulthandler
import os
import signal
import time
def work(n):
 time.sleep(0.1)
def main():
 faulthandler.register(signal.SIGUSR1)
 print("pid: %s" % os.getpid())
 with concurrent.futures.ProcessPoolExecutor() as executor:
 for number, prime in executor.map(work, range(100)):
 print("shutdown")
 executor.shutdown()
 print("shutdown--")
if __name__ == '__main__':
 main()
----------------------------
Trace:
----------------------------
Thread 0x00007fbfc83bd700:
 File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 237 in wait
 File "/home/haypo/prog/HG/cpython/Lib/multiprocessing/queues.py", line 252 in _feed
 File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 690 in run
 File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 737 in _bootstrap_inner
 File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 710 in _bootstrap
Thread 0x00007fbfc8bbe700:
 File "/home/haypo/prog/HG/cpython/Lib/multiprocessing/queues.py", line 101 in put
 File "/home/haypo/prog/HG/cpython/Lib/concurrent/futures/process.py", line 268 in _queue_management_worker
 File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 690 in run
 File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 737 in _bootstrap_inner
 File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 710 in _bootstrap
Current thread 0x00007fbfcc2e3700:
 File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 237 in wait
 File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 851 in join
 File "/home/haypo/prog/HG/cpython/Lib/concurrent/futures/process.py", line 395 in shutdown
 File "/home/haypo/prog/HG/cpython/Lib/concurrent/futures/_base.py", line 570 in __exit__
 File "y.py", line 17 in main
 File "y.py", line 20 in <module>
----------------------------
There are two child processes, but both are zombies (displayed as "<defunct>" by ps). Send SIGUSR1 signal to the frozen process to display the traceback (thanks to faulthandler).
History
Date User Action Args
2011年06月21日 01:05:35vstinnersetrecipients: + vstinner, pitrou, neologix
2011年06月21日 01:05:35vstinnersetmessageid: <1308618335.51.0.449763650808.issue12364@psf.upfronthosting.co.za>
2011年06月21日 01:05:34vstinnerlinkissue12364 messages
2011年06月21日 01:05:33vstinnercreate

AltStyle によって変換されたページ (->オリジナル) /