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

x/crypto/ssh: *Client Dial() example does not call Close() #41906

Closed
kevinburkemeter opened this issue Oct 10, 2020 · 1 comment
Closed

x/crypto/ssh: *Client Dial() example does not call Close() #41906

kevinburkemeter opened this issue Oct 10, 2020 · 1 comment
Milestone

Comments

@kevinburkemeter
Copy link

@kevinburkemeter kevinburkemeter commented Oct 10, 2020

The example for ssh.Dial in the x/crypto/ssh package opens a *Client. It then opens a *Session, which gets closed, but does not indicate that the *Client should be closed.

I didn't realize that the Client needed to be closed, and as a result, had a huge number of open SSH sessions on a server.

Related to this, the doc summary for the *Client only shows methods directly on the Client, not inherited methods - Close() is an inherited method. Scanning the doc header, I did not realize this.

ssh - GoDoc 2020-10-10 12-11-33

There are a few stackoverflow questions that indicate similar confusion

https://stackoverflow.com/a/42590388/329700
https://stackoverflow.com/a/62308528/329700

@gopherbot gopherbot added this to the Unreleased milestone Oct 10, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Oct 12, 2020

Change https://golang.org/cl/261417 mentions this issue: crypto/ssh: add Client.Close in Dial example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.