Skip to content

Client connections not closed on client deletion #1127

Open

Description

@pkittenis
client = paramiko.SSHClient('localhost')
client.exec_command('echo me')
del client

Connection still active. Resources not freed.

Creating more clients in same python process leads to memory leaks and eventually OOM.

Cause is client not calling transport.close() at any point.

Sub-classing SSHClient with a __del__ that includes transport.close() leads to race conditions and blocks most definitely related to cyclic references. This has been the case since 1.x and still persists in latest version.

Activity

  1. ploxiln commented on Nov 23, 2017

    @ploxiln
    Contributor

    Yup. see #964 #949

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions