Skip to content
This repository has been archived by the owner on Dec 5, 2018. It is now read-only.

Commit

Permalink
Wait indefinitely when launching slave agent with a timeout of zero
Browse files Browse the repository at this point in the history
Summary:
The docs claim that a timeout of zero means forever, but sometimes it
turns out to really mean zero. We correct that here.

Test Plan:
Ran the new code on our Jenkins installation, saw that we didn't get the
timeout message where Jenkins waits for only about 5 seconds before
claiming that it failed to launch the slave agent.

Reviewers: csilvers

Reviewed By: csilvers

Differential Revision: http://phabricator.khanacademy.org/D10554
  • Loading branch information
Chris Klaiber committed Jun 27, 2014
1 parent 6a3a658 commit d236a8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private Connection connectToSsh(EC2Computer computer, PrintStream logger) throws
while(true) {
try {
long waitTime = System.currentTimeMillis() - startTime;
if ( waitTime > timeout )
if ( timeout > 0 && waitTime > timeout )
{
throw new AmazonClientException("Timed out after "+ (waitTime / 1000) + " seconds of waiting for ssh to become available. (maximum timeout configured is "+ (timeout / 1000) + ")" );
}
Expand Down

0 comments on commit d236a8c

Please sign in to comment.