Message349852
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. |
|
Date |
User |
Action |
Args |
2019-08-16 08:45:17 | vinay0410 | set | recipients:
+ vinay0410, asvetlov, yselivanov, Dmitrii Ivaniushin |
2019-08-16 08:45:17 | vinay0410 | set | messageid: <1565945117.48.0.126596313518.issue37703@roundup.psfhosted.org> |
2019-08-16 08:45:17 | vinay0410 | link | issue37703 messages |
2019-08-16 08:45:17 | vinay0410 | create | |
|