Message370864
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. |
|
Date |
User |
Action |
Args |
2020-06-07 00:21:50 | aeros | set | recipients:
+ aeros, asvetlov, yselivanov, timmwagener |
2020-06-07 00:21:50 | aeros | set | messageid: <1591489310.8.0.336414704638.issue40894@roundup.psfhosted.org> |
2020-06-07 00:21:50 | aeros | link | issue40894 messages |
2020-06-07 00:21:49 | aeros | create | |
|