onyas opened a new pull request, #242: URL: https://github.com/apache/mina-sshd/pull/242
Hi there, We have encouraged an issue in which the SSHD doesn’t close the session when connecting timeout. The code we are using is attached here. https://gist.github.com/onyas/fda8ccf2d373c743ccec8f648782d078 The TCP socket is still ESTABLISHED after `sshClient.connect()` threw an exception. <img width="624" alt="image" src="https://user-images.githubusercontent.com/1592582/187923401-b6d21969-b3a9-4f45-8ec6-03d709a3dc89.png"> If I set the timeout to 1 millisecond, the `sshClient.connnect()` will throw an exception, since it’s timeout so the session is still null, and it doesn't help if we call `session.close()`. And we know we cloud call `sshClient.stop()`, but in our scenario, we reuse the same instance so we couldn’t do that. After checking the source code, we find the SSHD didn’t close the session when timeout. So I created this pull request to help close the session. Please help review and thanks. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
