[asyncio] cancelling task cancels awaited task instead
The issue boils down to this line:
| if self._fut_waiter.cancel(msg=msg): |
First off the bat, I realize this may be impossible to change due to backwards comp. Still, let's discuss.
Task A awaits task B. Someone cancels task A. Task B gets cancelled instead.
This probably makes sense in some contexts, for example if task A is the logical owner/parent of task B.
But in my case, task B was created in a long-lived taskgroup. Its lifecycle is independent of task A. They are now coupled by this invisible link created by the await.
I wonder if we could make this cancellation forwarding be skipped in some cases, like if the awaitee was created through a task group (since that mitigates the danger of leaking tasks).