Andrew Svetlov added the comment:
#46829 deprecates cancellation messages.
#46771 implements timeout context manager based on previously added
cancellation counter and task.uncancel()
I think this issue should be closed.
--
resolution: -> rejected
stage: -> resolved
status: open ->
Sam Bull added the comment:
I think there's still a problem, in that the user still expects a task to be
cancelled in the example previously:
https://github.com/aio-libs/async-timeout/issues/229#issuecomment-908502523
If we encounter the race condition where the timeout cancels the task and
Andrew Svetlov added the comment:
After TaskGroup merging, the second `cancel()` call returns `False` and doesn't
initiate the actual cancellation if it was scheduled by the first `cancel()`
call.
I believe it "fixes" async-timeout: the first canceller wins.
--
New submission from Sam Bull :
There are awkward edge cases caused by race conditions when cancelling tasks
which make it impossible to reliably cancel a task.
For example, in the async-timeout library there appears to be no way to avoid
suppressing an explicit t.cancel() if that cancellation