Author asvetlov
Recipients Ilya.Kulakov, asvetlov, chris.jerdonek, yselivanov
Date 2019-02-19.20:22:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I agree with Yuri.

`Task.set_exception()` (let's assume it works) is very dangerous: if cancellation exception doesn't bubble up from coroutine code there is a very high chance to get broken invariants and not-released resources.

The same situation is possible with classic threads: killing a thread without unwinding a call stack leads to locked mutexes etc.

Regarding distinguishing explicit cancellation from timeout exhausting: it can be done with current asyncio design by using a flag. Take a look on async_timeout context manager, __aexit__() implementation:
Date User Action Args
2019-02-19 20:22:58asvetlovsetrecipients: + asvetlov, chris.jerdonek, yselivanov, Ilya.Kulakov
2019-02-19 20:22:58asvetlovsetmessageid: <>
2019-02-19 20:22:58asvetlovlinkissue32363 messages
2019-02-19 20:22:58asvetlovcreate