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

Josh Rosenberg report at bugs.python.org
Wed Sep 2 19:33:27 EDT 2020


Josh Rosenberg <shadowranger+python at gmail.com> added the comment:

The problem is a lot simpler than you're making it:

1. You submit a time.sleep(30) task. This begins running immediately
2. You try to submit another task, but a NameError is raised, bypassing the rest of the code (you never call as_completed, with or without a timeout)
3. The ThreadPoolExecutor's __exit__ is invoked, which implicitly invokes shutdown(wait=True). This does not return until the successfully submitted task (time.sleep(30)) finished.
4. At that point, the exception that was interrupted by with statement cleanup resumes bubbling

All of this is behaving exactly as documented, no bug is occurring.

----------
nosy: +josh.r
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list