GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `_SSLProtocolTransport` keeps reference to protocol after close · Issue #98539 · python/cpython

_SSLProtocolTransport keeps reference to protocol after close #98539

New issue
Copy link
New issue
Copy link
Closed
Closed
_SSLProtocolTransport keeps reference to protocol after close#98539
Copy link
Assignees
kumaraditya303
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixestopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@kumaraditya303
kumaraditya303
opened on Oct 22, 2022
Issue body actions

_SSLProtocolTransport keeps reference to protocol after close. It leads to reference cyeles between the transport and the protocol and is bad for gc. Clearing this is better as it frees up the memory immediately without waiting for the gc. This causes memory leaks in some cases as if an exception occurs the deallocation is delayed even further as tracebacks keeps ref to frame and frame keeps locals alive.

cpython/Lib/asyncio/sslproto.py

Lines 102 to 111 in 8d57423

def close(self):
"""Close the transport.
Buffered data will be flushed asynchronously. No more data
will be received. After all buffered data is flushed, the
protocol's connection_lost() method will (eventually) called
with None as its argument.
"""
self._closed = True
self._ssl_protocol._start_shutdown()

Linked PRs

  • gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed #104474
  • [3.11] gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (GH-104474) #104485

Activity

  1. kumaraditya303
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    topic-asyncio
    3.11only security fixesonly security fixes
    3.12only security fixesonly security fixes
    on Oct 22, 2022
  2. kumaraditya303
    self-assigned this
    on Oct 22, 2022
  3. ezio-melotti
    added this to asyncioon Oct 22, 2022
  4. ezio-melotti
    moved this to Todo in asyncioon Oct 22, 2022
  5. gvanrossum
    added a commit that references this issue on Oct 22, 2022

    GH-98539: fix ref cycle in `_SSLProtocolTransport` after close (#98540)

    62bf5d8
  6. miss-islington
    added a commit that references this issue on Oct 22, 2022

    pythonGH-98539: fix ref cycle in `_SSLProtocolTransport` after close (p…

    1d222d3
  7. kumaraditya303 commented on Oct 22, 2022

    @kumaraditya303
    kumaraditya303
    on Oct 22, 2022
    ContributorAuthor
    More actions

    Fixed by #98540

  8. kumaraditya303
    closed this as completedon Oct 22, 2022
  9. Repository owner moved this from Todo to Done in asyncioon Oct 22, 2022
  10. gvanrossum
    added a commit that references this issue on Oct 24, 2022

    [3.11] GH-98539: fix ref cycle in `_SSLProtocolTransport` after close (…

    bd8b32b
  11. gvanrossum
    added a commit that references this issue on May 14, 2023

    gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (…

    fb8739f
  12. miss-islington
    added a commit that references this issue on May 14, 2023

    pythongh-98539: Make _SSLTransportProtocol.abort() safe to call when …

    04c1a3c
  13. gvanrossum
    added a commit that references this issue on May 14, 2023

    [3.11] gh-98539: Make _SSLTransportProtocol.abort() safe to call when…

    1afc0a9
  14. carljm
    added 2 commits that reference this issue on May 15, 2023

    Merge branch 'main' into supermon

    343867a

    Merge branch 'main' into cached_property_docs

    452d9f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kumaraditya303
    kumaraditya303

Labels

3.11only security fixesonly security fixes3.12only security fixesonly security fixestopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

  • asyncio
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.