New submission from bbh <benj.lue...@gmx.net>:
concurrent.futures.ThreadPoolExecutor.shutdown(cancel_futures=True) cancels the pending futures, but the futures remain in the state CANCELLED and never get to the state CANCELLED_AND_NOTIFIED. Thus they are never yielded by concurrent.futures.as_completed(). If I use shutdown(cancel_futures=True) in a loop of as_completed(), the loop will never finish and the program hangs. Not even Ctrl-C works. If I use concurrent.futures.Future.cancel() on all pending futures in the loop, everything works as expected. ---------- components: Library (Lib) messages: 390183 nosy: bigbenhur priority: normal severity: normal status: open title: futures cancelled by ThreadPoolExecutor.shutdown() not yielded by as_completed() type: behavior versions: Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43727> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com