-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
asyncio: potential leak of TLS connections #106684
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
Labels
3.11
only security fixes
3.12
only security fixes
3.13
bugs and security fixes
performance
Performance or resource usage
topic-asyncio
type-bug
An unexpected behavior, bug, or error
Comments
kumaraditya303
added a commit
that referenced
this issue
Aug 5, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Aug 5, 2023
…is not closed (pythonGH-107650) (cherry picked from commit 41178e4) Co-authored-by: Kumar Aditya <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Aug 5, 2023
…is not closed (pythonGH-107650) (cherry picked from commit 41178e4) Co-authored-by: Kumar Aditya <[email protected]>
evildmp
pushed a commit
to evildmp/cpython
that referenced
this issue
Aug 5, 2023
…is not closed (python#107650)
Yhg1s
pushed a commit
that referenced
this issue
Aug 10, 2023
…iter` is not closed by application (GH-107650) (#107656) GH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed (GH-107650) (cherry picked from commit 41178e4) Co-authored-by: Kumar Aditya <[email protected]> Co-authored-by: Kumar Aditya <[email protected]>
miss-islington
added a commit
to miss-islington/cpython
that referenced
this issue
Aug 10, 2023
…reamWriter` is not closed by application (pythonGH-107650) (pythonGH-107656) pythonGH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed (pythonGH-107650) (cherry picked from commit 41178e4) (cherry picked from commit 7853c76) Co-authored-by: Miss Islington (bot) <[email protected]> Co-authored-by: Kumar Aditya <[email protected]> Co-authored-by: Kumar Aditya <[email protected]>
kumaraditya303
added a commit
that referenced
this issue
Aug 10, 2023
…treamWriter` is not closed by application (GH-107650) (GH-107656) (#107836) [3.12] GH-106684: Close `asyncio.StreamWriter` when `asyncio.StreamWriter` is not closed by application (GH-107650) (GH-107656) GH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed (GH-107650) (cherry picked from commit 41178e4) (cherry picked from commit 7853c76) Co-authored-by: Kumar Aditya <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.11
only security fixes
3.12
only security fixes
3.13
bugs and security fixes
performance
Performance or resource usage
topic-asyncio
type-bug
An unexpected behavior, bug, or error
Bug report
Synopsis
Forgetting to close TLS connections manually with
asyncio.open_connection()
will lead to a leak of TCP connection when the writer/reader get out of scopeNote: the reference is properly released when the remote side closes the connection
This seems to be counter intuitive relative to other python APIs where the connection is closed when the handle goes out of scope
Details
asyncio.open_connection(..., ssl=True)
writer.close()
When trying to debug this issue I found out that a
_SSLProtocolTransport
instance is kept in memory, probably linked to the eventloopExample script
Your environment
Linked PRs
asyncio.StreamWriter
whenasyncio.StreamWriter
is not closed by application (GH-107650) #107656ResourceWarning
whenasyncio.StreamWriter
is not closed (GH-107650) #107657asyncio.StreamWriter
whenasyncio.StreamWriter
is not closed by application (GH-107650) (GH-107656) #107836The text was updated successfully, but these errors were encountered: