New submission from STINNER Victor <vstin...@redhat.com>:

The following code hangs:
---
import multiprocessing, time
pool = multiprocessing.Pool(1)
result = pool.apply_async(time.sleep, (1.0,))
pool.terminate()
result.get()
---

pool.terminate() terminates workers before time.sleep(1.0) completes, but the 
pool doesn't mark result as completed with an error.

Would it be possible to mark all pending tasks as failed? For example, "raise" 
a RuntimeError("pool terminated before task completed").

----------
components: Library (Lib)
messages: 331724
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: multiprocessing: ApplyResult.get() hangs if the pool is terminated
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35478>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to