-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CODENVY-2217: Change checking for SSH agent readiness #5260
Conversation
BufferedOutputStream sshRequest = new BufferedOutputStream(socket.getOutputStream()); | ||
BufferedInputStream sshResponse = new BufferedInputStream(socket.getInputStream())) { | ||
sshRequest.write(SSH_GLOBAL_REQUEST_BYTES); | ||
sshRequest.flush(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format the code.
sshRequest.write(SSH_GLOBAL_REQUEST_BYTES); | ||
sshRequest.flush(); | ||
// Actual response is not needed, just make sure that ssh server give a response. | ||
if (sshResponse.read() != -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retrun sshResponse.read() != -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that current code looks clearer.
Signed-off-by: Mykola Morhun <mmorhun@codenvy.com>
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/2732/ |
What does this PR do?
Changes checking algorithm for SSH agent.
Before, a readiness of SSH agent was checked by an attempt to open socket connection to SSH port of the machine. But this method doesn't work properly in some cases. For example, in case of docker-proxy socket connection will be opened, but actually the port isn't listening. This will cause workspace start failure.
That problem was fixed by changing of SSH agent readiness checking algorithm. Now checker tries to send a global SSH request and if SSH server is up, it should respond.
What issues does this PR fix or reference?
codenvy/codenvy#2217
Changelog
Improved SSH agent readiness checker.
Release Notes
Improved SSH agent readiness checker. This fixes workspace start failures from images without ssh server preinstalled.
Docs PR
N/A