-
Notifications
You must be signed in to change notification settings - Fork 18k
x/crypto/ssh: leaks connections? #28613
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
Comments
If your session setup fails, you still need to close the client. |
thanks, I will cover this case. but that does not explain the 64 open connections. I got only one error before the 64 connection limit was reached. the error was: 2018/11/05 14:56:00 ssh run error: host: xxx command: xxx error: wait: remote command exited without exit status or exit signal i will try with a defer client.Close() after the successful dial, to ensure that the connection is closed. But it seems this was done earlier somehow by the library itself. |
i have checked, and the So it seems there was a change recently that makes this call mandatory. (maybe the connection was previously closed during |
I'm not aware of any recent changes, and as long as I can remember it's been required to call close. You might've just got lucky before. /cc @hanwen in any case he remembers anything. But otherwise I'm going to close this as nothing to do. |
as long as you don't close the client, you can start new sessions using same the client. This is useful because then you don't have to a new handshake, or do a new login for each new session. |
my client was running nearly 2 month without reaching the 64 connection limit before. thank for your answer and your time! Could you please update the documentation about this, at least the example from Dial should contain imho the call to Close(). |
I promise that it did not. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?i cross compile with:
for SLES 12.3
go env for build env:
What did you do?
i followed the Dial example on:
https://godoc.org/golang.org/x/crypto/ssh#Dial
exact code:
This leads newly (i updated recently the ssh repo) to the following error message of the ssh server:
The ssh server restricts to max 64 concurrent connections per user.
It seems like some change in the library code misses internal cleanup or do i need additional cleanup on my side?
thanks
regards Fabian
The text was updated successfully, but these errors were encountered: