diff options
author | romasku <romasku135@gmail.com> | 2020-05-15 20:12:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 20:12:05 (GMT) |
commit | 382a5635bd10c237c3e23e346b21cde27e48d7fa (patch) | |
tree | aeafbddb7b6a726cb148345269719c79043354d7 /Doc | |
parent | c087a268a4d4ead8ef2ca21e325423818729da89 (diff) | |
download | cpython-382a5635bd10c237c3e23e346b21cde27e48d7fa.zip cpython-382a5635bd10c237c3e23e346b21cde27e48d7fa.tar.gz cpython-382a5635bd10c237c3e23e346b21cde27e48d7fa.tar.bz2 |
bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() (GH-20054)
Currently, if asyncio.wait_for() timeout expires, it cancels
inner future and then always raises TimeoutError. In case
those future is task, it can handle cancelation mannually,
and those process can lead to some other exception. Current
implementation silently loses thoses exception.
To resolve this, wait_for will check was the cancelation
successfull or not. In case there was exception, wait_for
will reraise it.
Co-authored-by: Roman Skurikhin <roman.skurikhin@cruxlab.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/asyncio-task.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 42e2b4e..bc8a272 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -453,7 +453,8 @@ Timeouts wrap it in :func:`shield`. The function will wait until the future is actually cancelled, - so the total wait time may exceed the *timeout*. + so the total wait time may exceed the *timeout*. If an exception + happens during cancellation, it is propagated. If the wait is cancelled, the future *aw* is also cancelled. |