[issue41694] python3 futures.as_completed timeout broken if future contains undefined reference

Dallas Marlow report at bugs.python.org
Wed Sep 2 12:33:05 EDT 2020


Dallas Marlow <dallasmarlow at gmail.com> added the comment:

After closer inspection it seems as though timeouts are not working as I would expect even when there are no undefined references. The following code runs for 30s when I would expect a timeout exception thrown after 1 second. as_completed eventually does throw a timeout exception, but only after the sleep future completes.

###############################

import concurrent.futures
import time

with concurrent.futures.ThreadPoolExecutor() as ex:
	futures = [
		ex.submit(time.sleep, 30),
		ex.submit(print, 'test'),
	]
	for future in concurrent.futures.as_completed(futures, timeout=1):
		_ = future.result()

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41694>
_______________________________________


More information about the Python-bugs-list mailing list