Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #66 from mriddle/master
JENKINS-19500 Remove slave from Jenkins even when instance termination fails
  • Loading branch information
francisu committed Sep 22, 2013
2 parents 53d256a + 5d49a41 commit 0698416
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/java/hudson/plugins/ec2/EC2SpotSlave.java
Expand Up @@ -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);
LOGGER.log(Level.WARNING, "Failed to terminated instance and cancel Spot request: " + spotInstanceRequestId, e);
} 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);
LOGGER.log(Level.WARNING, "Failed to terminated instance and cancel Spot request: " + spotInstanceRequestId, e);
}

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

/**
Expand Down

0 comments on commit 0698416

Please sign in to comment.