Skip to content

Commit

Permalink
Merge pull request #367 from 10eTechnology/fixing-JENKINS-53952
Browse files Browse the repository at this point in the history
fixing JENKINS-53952: wait for spot instances to get an instance id
  • Loading branch information
thoulen committed Jul 4, 2019
2 parents b387e48 + 1504b9f commit 597af44
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,13 @@ private Connection connectToSsh(EC2Computer computer, TaskListener listener) thr
}
String host = getEC2HostAddress(computer);

if ((node instanceof EC2SpotSlave) && computer.getInstanceId() == null) {
// getInstanceId() on EC2SpotSlave can return null if the spot request doesn't yet know
// the instance id that it is starting. Continue to wait until the instanceId is set.
logInfo(computer, listener, "empty instanceId for Spot Slave.");
throw new IOException("goto sleep");
}

if ("0.0.0.0".equals(host)) {
logWarning(computer, listener, "Invalid host 0.0.0.0, your host is most likely waiting for an ip address.");
throw new IOException("goto sleep");
Expand Down

0 comments on commit 597af44

Please sign in to comment.