[issue37703] Inconsistent gather with child exception

Vinay Sharma report at bugs.python.org
Fri Aug 16 04:45:17 EDT 2019


Vinay Sharma <vinay0410sharma at gmail.com> added the comment:

Hi Dimitri,
You are right, gather.cancel() doesn't work once it has propagated an exception. This happens because after propagating the exception to the caller, gather is marked as done. And cancel doesn't work after a Future object has been marked done.
You can test the same by printing the return value of gather.cancel(). It will be False

I also believe that the documentation of gather should explicitly mention this. But, depending on the fact, whether this is an expected behaviour, current code base might also need changes.

Therefore I have created two patches, one updating the current documentation according to the current functionality, and other changing the codebase which supports cancelling even after raising exceptions.

I will try to contact one of the core developers on deciding which one is the way to go.

----------
keywords: +patch
nosy: +vinay0410
Added file: https://bugs.python.org/file48547/gather_cancel_doc.patch

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


More information about the Python-bugs-list mailing list