-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-31620: asyncio.Queue leaks memory if the queue is empty and the consumers poll it frequently #3813
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
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
|
signed the CLA. awaiting on profile update. |
|
My profile just updated to having the CLA but i am not sure how to trigger an update. |
|
asyncio.Queue.put also suffers from a similar bug. I'll fix that in a different PR once we merge this so all the corrections we make to this PR get transferred over. |
Lib/asyncio/queues.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is O(n) in the length of the _getters deque, which is a bit unfortunate. Perhaps it's fine since this deque should usually be short.
Lib/test/test_asyncio/test_queues.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected output is expected to come second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That file is a bit consistent on the front. happy to change it in this line or change entire file to be consistent with that convention. just lmk.
asvetlov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Sorry for delay.
|
@1st1 do you want to merge or should I do it? |
|
Thanks @SurenNihalani for the PR, and @asvetlov for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
… during waiting (pythonGH-3813) (cherry picked from commit c62f0cb)
|
GH-4326 is a backport of this pull request to the 3.6 branch. |
https://bugs.python.org/issue31620