Dallas Marlow added the comment:
I apologize for all the messages, but the more I look into this issue the
stranger it seems. The following code does the following:
- print the time
- execute 3 futures (2 w/ 30s sleeps)
- call as_completed
- catch the timeout exception
- print the time again
Dallas Marlow added the comment:
I also verified that this issue persists with blocking futures other than sleep
calls:
import concurrent.futures
import subprocess
with concurrent.futures.ThreadPoolExecutor() as ex:
futures = [
ex.submit(subprocess.run, ['sleep&
Dallas Marlow 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
New submission from Dallas Marlow :
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