[New-bugs-announce] [issue41694] python3 futures.as_completed timeout broken if future contains undefined reference
Dallas Marlow
report at bugs.python.org
Wed Sep 2 12:15:41 EDT 2020
New submission from Dallas Marlow <dallasmarlow at gmail.com>:
I recently noticed that timeouts do not work with futures.as_completed if a future contains an undefined variable or method. The following code runs for 30 seconds which I believe is a bug as I would expect the invalid print future to throw an exception immediately or the as_completed method throw an exception instead.
#########################
import concurrent.futures
with concurrent.futures.ThreadPoolExecutor() as ex:
futures = [
ex.submit(time.sleep, 30),
ex.submit(print, a),
]
for future in concurrent.futures.as_completed(futures, timeout=1):
_ = future.result()
----------
components: Interpreter Core
messages: 376250
nosy: dallasmarlow
priority: normal
severity: normal
status: open
title: python3 futures.as_completed timeout broken if future contains undefined reference
versions: Python 3.6, Python 3.7, Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41694>
_______________________________________
More information about the New-bugs-announce
mailing list