Skip to content
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

test_ssl: reference cycle between ThreadedEchoServer and its ConnectionHandler #75504

Closed
vstinner opened this issue Sep 1, 2017 · 4 comments
Closed
Labels
3.7 (EOL) end of life performance Performance or resource usage tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

vstinner commented Sep 1, 2017

BPO 31323
Nosy @vstinner
PRs
  • bpo-31323: Fix reference leak in test_ssl #3263
  • [3.6] bpo-31323: Fix reference leak in test_ssl (GH-3263) #3538
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-09-13.20:56:41.797>
    created_at = <Date 2017-09-01.14:58:24.937>
    labels = ['3.7', 'tests', 'performance']
    title = 'test_ssl: reference cycle between ThreadedEchoServer and its ConnectionHandler'
    updated_at = <Date 2017-09-13.20:56:41.796>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2017-09-13.20:56:41.796>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-09-13.20:56:41.797>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2017-09-01.14:58:24.937>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31323
    keywords = ['patch']
    message_count = 4.0
    messages = ['301116', '301156', '302044', '302054']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['3263', '3538']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue31323'
    versions = ['Python 3.7']

    @vstinner
    Copy link
    Member Author

    vstinner commented Sep 1, 2017

    While testing bpo-31234 fix, I noticed that some test_ssl tests using ThreadedEchoServer create reference cycles with ConnectionHandler: ConnectionHandler fills ThreadedEchoServer.conn_errors with exceptions, but exceptions keep an alive traceback object which contains frame locals.

    I tried to use traceback.clear_frames(), but this function is broken: see bpo-31321.

    Attached PR works around the issue by storing errors are text rather than objects.

    The PR prevents warnings about dangling threads.

    @vstinner vstinner added 3.7 (EOL) end of life tests Tests in the Lib/test dir performance Performance or resource usage labels Sep 1, 2017
    @vstinner
    Copy link
    Member Author

    vstinner commented Sep 1, 2017

    New changeset 8687101 by Victor Stinner in branch 'master':
    bpo-31323: Fix reference leak in test_ssl (bpo-3263)
    8687101

    @vstinner
    Copy link
    Member Author

    I don't think that Python 2.7 is affected since Exception has no __traceback__ attribute in Python 2.7.

    @vstinner
    Copy link
    Member Author

    New changeset 1b00bdd by Victor Stinner (Miss Islington (bot)) in branch '3.6':
    [3.6] bpo-31323: Fix reference leak in test_ssl (GH-3263) (bpo-3538)
    1b00bdd

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life performance Performance or resource usage tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant