-
Notifications
You must be signed in to change notification settings - Fork 319
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
Waiter until ssh connection can be estabilished #230
Conversation
This conflicts with my work where i'm cleanuping DockerTemplate/Base/Slave/launcher and other classes. I'm unbundling launchers. So i wouldn't merge this change. |
LOGGER.info("Try to connect to sshd on {}:{}", host, port); | ||
|
||
waitForSshOn(host, port); | ||
super.launch(computer, listener); |
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.
I think after #234 it will be possible just to have retries as additional option for DockerSSHComputerLauncher, because it already wrapping sshlauncher/sshconnector to have ability to choose/configure launcher in UI.
* @param time number of units | ||
* @param units to convert to millis | ||
*/ | ||
private static void sleepFor(int time, TimeUnit units) { |
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.
Please make it public
Could you send in separate PR PortUtils changes without removing/adding ssh launcher? |
And could you unhardcode timeout values? |
- also remove unused method - add javadocs - every timeout settable
socket = new Socket(host, port); | ||
available = true; | ||
private int retries = 10; | ||
private int sshTimeoutMillis = (int) SECONDS.toMillis(2); |
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.
mm... maybe better long?
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.
ConnectionInfo connect(ServerHostKeyVerifier verifier, int connectTimeout, int readTimeout, int kexTimeout)
- that's the main cause of int cast
Waiter until ssh connection can be estabilished
} | ||
|
||
/** | ||
* @param host hostname to connect to |
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.
Some description about what kind of connection required: tcp/udp/ssh?
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.
only tcp. Will add it next time
also: