Skip to content
This repository was archived by the owner on Jun 1, 2021. It is now read-only.
This repository was archived by the owner on Jun 1, 2021. It is now read-only.

calls to rapl/Cap.go#Cap() result in connection leaks. #20

Description

@pradykaushik

rapl power cap does not close the ssh connection. Even though the ssh session is closed, the connection is still maintained to allow for establishing new sessions without having to redo the handshake. However, the existing code establishes a new connection on each call to the function. This results in the tcp: accept4: too many open connections error.

There are two ways to go about this.

  1. Establish the connection once and maintain the connection object. Subsequent ssh sessions should be opened using the same connection object. Ssh connection object should be closed when no longer needed.
  2. Close the ssh connection object (defer connection.Close()) before returning from the function.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingmajorof high importance

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions