New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asyncio: cancelling gather only cancels 1st awaited task (differs from CPython) #7901
Labels
Comments
dpgeorge
added a commit
to dpgeorge/micropython
that referenced
this issue
Mar 29, 2022
The following fixes are made: - cancelling a gather now cancels all sub-tasks of the gather (previously it would only cancel the first) - if any sub-task of a gather raises an exception then the gather finishes (previously it would only finish if the first sub-task raised) Fixes issues micropython#5798, micropython#7807, micropython#7901. Signed-off-by: Damien George <damien@micropython.org>
dpgeorge
added a commit
to dpgeorge/micropython
that referenced
this issue
Mar 29, 2022
The following fixes are made: - cancelling a gather now cancels all sub-tasks of the gather (previously it would only cancel the first) - if any sub-task of a gather raises an exception then the gather finishes (previously it would only finish if the first sub-task raised) Fixes issues micropython#5798, micropython#7807, micropython#7901. Signed-off-by: Damien George <damien@micropython.org>
dpgeorge
added a commit
to dpgeorge/micropython
that referenced
this issue
Mar 30, 2022
The following fixes are made: - cancelling a gather now cancels all sub-tasks of the gather (previously it would only cancel the first) - if any sub-task of a gather raises an exception then the gather finishes (previously it would only finish if the first sub-task raised) Fixes issues micropython#5798, micropython#7807, micropython#7901. Signed-off-by: Damien George <damien@micropython.org>
Fixed by 90aaf2d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In CPython, when a task awaiting
asyncio.gather
is cancelled,gather
gets cancelled, and then all tasksgather
is awaiting are cancelled. In MicroPython v1.17, it seems only the firstgather
task gets cancelled:Note that
test2
tasks keep accumulating, whereastest1
gets cancelled correctly. Interestingly, these uncancelled tasks stay in the event loop even afterrun()
completes normally, so that future runs include the "zombie" test2's.Both of these behavior differ from CPython (v3.9.7).
The text was updated successfully, but these errors were encountered: