[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
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

bpo-34745: Fix asyncio sslproto memory issues #12386

Merged
merged 4 commits into from Mar 17, 2019

Conversation

Copy link
Contributor

fantix commented Mar 17, 2019

These issues are not strictly memory leaks, but they do affect the memory footprint and garbage collection if called frequently.

  • Handshake timeout not cleaned in time
  • Circular reference between _SSLPipe and SSLProtocol
  • Circular reference between SSLProtocol and UserProtocol

https://bugs.python.org/issue34745

Before the fix:

After the fix:

1st1 approved these changes Mar 17, 2019
1st1 merged commit f683f46 into python:master Mar 17, 2019
Copy link
Contributor

miss-islington commented Mar 17, 2019

Thanks @fantix for the PR, and @1st1 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒🤖

Copy link

bedevere-bot commented Mar 17, 2019

GH-12387 is a backport of this pull request to the 3.7 branch.

Copy link
Contributor

miss-islington commented Mar 17, 2019

Sorry, @fantix and @1st1, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker f683f464259715d620777d7ed568e701337a703a 3.6

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 17, 2019
* Fix handshake timeout leak in asyncio/sslproto

Refs MagicStack/uvloopGH-222

* Break circular ref _SSLPipe <-> SSLProtocol

* bpo-34745: Fix asyncio ssl memory leak

* Break circular ref SSLProtocol <-> UserProtocol

* Add NEWS entry
(cherry picked from commit f683f46)

Co-authored-by: Fantix King <fantix.king@gmail.com>
Copy link
Member

1st1 commented Mar 17, 2019

@fantix Could you please make a pr against 3.6?

Copy link
Contributor Author

fantix commented Mar 17, 2019

@1st1 sure thing, thanks for the quick response!

miss-islington added a commit that referenced this pull request Mar 17, 2019
* Fix handshake timeout leak in asyncio/sslproto

Refs MagicStack/uvloopGH-222

* Break circular ref _SSLPipe <-> SSLProtocol

* bpo-34745: Fix asyncio ssl memory leak

* Break circular ref SSLProtocol <-> UserProtocol

* Add NEWS entry
(cherry picked from commit f683f46)

Co-authored-by: Fantix King <fantix.king@gmail.com>
fantix deleted the fix-sslproto-handshake-timeout-leak branch Mar 18, 2019
fantix added a commit to fantix/cpython that referenced this pull request Mar 18, 2019
* Fix handshake timeout leak in asyncio/sslproto, refs MagicStack/uvloop#222

* Break circular ref _SSLPipe <-> SSLProtocol

* bpo-34745: Fix asyncio ssl memory leak

* Break circular ref SSLProtocol <-> UserProtocol

* Add NEWS entry
Copy link

bedevere-bot commented Mar 18, 2019

GH-12393 is a backport of this pull request to the 3.6 branch.

Copy link

sepetnit commented Apr 9, 2021

Hi guys, sorry for reopening such an old issue. I'm just playing with asyncio+ssl.
My python version is 3.6.9; my asyncio version is 3.4.3. I still see the memory leak.
What can I upgrade in order to have this issue fixed in my current environment?

Thanks a lot,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants