This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay0410
Recipients Dmitrii Ivaniushin, asvetlov, vinay0410, yselivanov
Date 2019-08-16.08:45:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565945117.48.0.126596313518.issue37703@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-08-16 08:45:17vinay0410setrecipients: + vinay0410, asvetlov, yselivanov, Dmitrii Ivaniushin
2019-08-16 08:45:17vinay0410setmessageid: <1565945117.48.0.126596313518.issue37703@roundup.psfhosted.org>
2019-08-16 08:45:17vinay0410linkissue37703 messages
2019-08-16 08:45:17vinay0410create