New submission from Dallas Marlow <dallasmar...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue41694>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to