This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: asyncio._wait() don't remove callback in case of exception
Type: resource usage Stage: resolved
Components: asyncio Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, gescheit, miss-islington, yselivanov
Priority: normal Keywords: patch

Created on 2019-04-12 12:38 by gescheit, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
asyncio_wait_callbacks_leak.py gescheit, 2019-04-12 12:38
Pull Requests
URL Status Linked Edit
PR 12800 merged gescheit, 2019-04-12 12:52
PR 13076 merged miss-islington, 2019-05-03 15:18
Messages (3)
msg340034 - (view) Author: Aleksandr Balezin (gescheit) * Date: 2019-04-12 12:38
Attached script shows unexpected behavior of the wait() function.
The wait_ function adds done callback on every call and removes it only if a waiter is successfully awaited. In case of CancelledError exception during "await waiter", callbacks are being accumulated infinitely in task._callbacks.
msg341343 - (view) Author: miss-islington (miss-islington) Date: 2019-05-03 15:18
New changeset c1964e9e2177eabe821f3e4243be8b99e0d2d542 by Miss Islington (bot) (gescheit) in branch 'master':
bpo-36613: call remove_done_callback if exception (GH-12800)
https://github.com/python/cpython/commit/c1964e9e2177eabe821f3e4243be8b99e0d2d542
msg341345 - (view) Author: miss-islington (miss-islington) Date: 2019-05-03 15:35
New changeset 769ac7e7b809dfc60abd0d7e6f020c6ffe06a6c0 by Miss Islington (bot) in branch '3.7':
bpo-36613: call remove_done_callback if exception (GH-12800)
https://github.com/python/cpython/commit/769ac7e7b809dfc60abd0d7e6f020c6ffe06a6c0
History
Date User Action Args
2022-04-11 14:59:13adminsetgithub: 80794
2019-05-03 15:35:54miss-islingtonsetmessages: + msg341345
2019-05-03 15:19:10asvetlovsetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: - Python 3.6
2019-05-03 15:18:17miss-islingtonsetpull_requests: + pull_request12990
2019-05-03 15:18:06miss-islingtonsetnosy: + miss-islington
messages: + msg341343
2019-04-12 12:52:46gescheitsetkeywords: + patch
stage: patch review
pull_requests: + pull_request12728
2019-04-12 12:38:08gescheitcreate