Commit 1598dfff by Sébastien Eustace Committed by GitHub

Ensure tasks are cancelled when executor is shut down (#2656)

parent 27d1599e
...@@ -119,6 +119,8 @@ class Executor(object): ...@@ -119,6 +119,8 @@ class Executor(object):
self._shutdown = True self._shutdown = True
if self._shutdown: if self._shutdown:
# Cancelling further tasks from being executed
[task.cancel() for task in tasks]
self._executor.shutdown(wait=True) self._executor.shutdown(wait=True)
break break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment