You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
asyncio.wait_for should reraise future exception even if timeout expires #84787
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-05-18.06:09:08.489>created_at=<Date2020-05-12.11:33:07.250>labels= ['type-bug', '3.9', 'expert-asyncio']
title='asyncio.wait_for should reraise future exception even if timeout expires'updated_at=<Date2020-05-18.06:09:08.487>user='https://github.com/romasku'
Also adding Nathaniel since he's the one that filed bpo-32751. Nathaniel, do you agree that if an exception occurs while waiting for the cancellation, the exception should be what's raised instead of TimeoutError?
Also adding Nathaniel since he's the one that filed bpo-32751. Nathaniel, do you agree that if an exception occurs while waiting for the cancellation, the exception should be what's raised instead of TimeoutError?
Activity
romasku commentedon May 12, 2020
In https://bugs.python.org/issue32751 asyncio.wait_for behaviour was changed that when we use timeout=... and the timeout expires, it waits until task is canceled. However, in some cases inner task can trigger exception while it handles cancellation. Check the following code:
It will print "Timeout" and log a warning that "Task exception was never retrieved".
I think that in case inner task cancelation fails with some error, asyncio.wait_for should reraise it instead of silently losing it.
cjerdonek commentedon May 13, 2020
Also adding Nathaniel since he's the one that filed bpo-32751. Nathaniel, do you agree that if an exception occurs while waiting for the cancellation, the exception should be what's raised instead of TimeoutError?
njsmith commentedon May 13, 2020
makes sense to me
On Tue, May 12, 2020 at 10:14 PM Chris Jerdonek <[email protected]> wrote:
1st1 commentedon May 13, 2020
+1.
1st1 commentedon May 15, 2020
New changeset 382a563 by romasku in branch 'master':
bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() (GH-20054)
382a563
cjerdonek commentedon May 18, 2020
Thank you again, Roman and all.