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 aeros
Recipients aeros, asvetlov, timmwagener, yselivanov
Date 2020-06-07.00:21:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591489310.8.0.336414704638.issue40894@roundup.psfhosted.org>
In-reply-to
Content
Thank you for the bug report Timm.

While I can certainly understand the source of the confusion here, I think you may be misunderstanding an important part of cancellation for futures. Specifically a future can't be cancelled once it reaches the PENDING state, this is indicated when future.cancel() returns false; see https://github.com/python/cpython/blob/0e96c419d7287c3c7f155c9f2de3c61020386256/Lib/asyncio/futures.py#L152 for the source code. In your example code snippet, you can also see this if you replace the line:

```
future_gather.cancel()
```
with the following:
```
if not future_gather.cancel():
    logger.info("future_gather could not be cancelled")
```

Also, to clarify on something else:
> However, my understanding is that asyncio.gather() is scheduled for deprecation, so maybe changes in this area are on halt anyways!?

asyncio.gather() is not deprecated or scheduled for deprecation, it is simply the loop argument being deprecated.
History
Date User Action Args
2020-06-07 00:21:50aerossetrecipients: + aeros, asvetlov, yselivanov, timmwagener
2020-06-07 00:21:50aerossetmessageid: <1591489310.8.0.336414704638.issue40894@roundup.psfhosted.org>
2020-06-07 00:21:50aeroslinkissue40894 messages
2020-06-07 00:21:49aeroscreate