Vinay Sharma <vinay0410sha...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue37703>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to