[issue11724] concurrent.futures: executor.submit() runs until completion even when future times out or is canceled

Brian Quinlan report at bugs.python.org
Thu Mar 31 06:31:57 CEST 2011


Brian Quinlan <brian at sweetapp.com> added the comment:

This is the expected behavior.

Future.cancel() returns a bool indicating if the future was cancelled or not. If it returns False then there is no way to stop it.

The behavior that you are seeing for shutdown is documented as:
"""
shutdown(wait=True)
...

If wait is True then this method will not return until all the pending futures are done executing and the resources associated with the executor have been freed. If wait is False then this method will return immediately and the resources associated with the executor will be freed when all pending futures are done executing. Regardless of the value of wait, the entire Python program will not exit until all pending futures are done executing.
"""

----------
resolution:  -> invalid

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11724>
_______________________________________


More information about the Python-bugs-list mailing list