Skip to content
Permalink
Browse files

JENKINS-19500 Fix: Remove slave from Jenkins even when instance termi…

…nation fails

Since we assume that the Spot request is no longer valid if an AmazonClientException/AmazonServiceException occurs
  • Loading branch information
Matt Riddle
Matt Riddle committed Sep 12, 2013
1 parent 53d256a commit 11693e7be0f4fe2b9979aaad1074725f9056921e
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/main/java/hudson/plugins/ec2/EC2SpotSlave.java
@@ -69,18 +69,20 @@ public void terminate() {
}

}
Hudson.getInstance().removeNode(this);


} catch (AmazonServiceException e){
// Spot request is no longer valid
LOGGER.log(Level.WARNING, "Failed to terminated instance and cancel Spot request: " + spotInstanceRequestId);
} catch (AmazonClientException e){
// Spot request is no longer valid
LOGGER.log(Level.WARNING, "Failed to terminated instance and cancel Spot request: " + spotInstanceRequestId);
} catch(IOException e){
LOGGER.log(Level.WARNING,"Failed to remove slave: "+name, e);
}

try{
Hudson.getInstance().removeNode(this);
} catch (IOException e){
LOGGER.log(Level.WARNING,"Failed to remove slave: "+name, e);
}
}

/**

0 comments on commit 11693e7

Please sign in to comment.
You can’t perform that action at this time.