Skip to content

bpo-34745: Fix asyncio sslproto memory issues#12386

Merged
1st1 merged 4 commits into
python:masterfrom
fantix:fix-sslproto-handshake-timeout-leak
Mar 17, 2019
Merged

bpo-34745: Fix asyncio sslproto memory issues#12386
1st1 merged 4 commits into
python:masterfrom
fantix:fix-sslproto-handshake-timeout-leak

Conversation

@fantix

@fantix fantix commented Mar 17, 2019

Copy link
Copy Markdown
Contributor

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:

cpython-bpo-issue

After the fix:

cpython-bpo-fixed

@1st1 1st1 merged commit f683f46 into python:master Mar 17, 2019
@miss-islington

Copy link
Copy Markdown
Contributor

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

@bedevere-bot

Copy link
Copy Markdown

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

@miss-islington

Copy link
Copy Markdown
Contributor

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>
@1st1

1st1 commented Mar 17, 2019

Copy link
Copy Markdown
Member

@fantix Could you please make a pr against 3.6?

@fantix

fantix commented Mar 17, 2019

Copy link
Copy Markdown
Contributor Author

@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 fantix deleted the fix-sslproto-handshake-timeout-leak branch March 18, 2019 04:34
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
@bedevere-bot

Copy link
Copy Markdown

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

@sepetnit

sepetnit commented Apr 9, 2021

Copy link
Copy Markdown

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.

6 participants