Skip to content

Commit

Permalink
fabric8io#177: Deleting a container should first use stop, before kill.
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus authored and Jenkins committed Dec 4, 2014
1 parent 6aeeb38 commit ed5bbf9
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions node/src/main/java/io/fabric8/jube/local/NodeHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,22 @@ protected static void deleteContainer(ProcessManager processManager, KubernetesM
return;
}
ProcessController controller = installation.getController();
controller.kill();
controller.uninstall();
// try graceful to stop first, then kill afterwards
try {
controller.stop();
} catch (Exception e) {
LOG.warn("Error during stopping container. Will now attempt to forcibly kill the container.", e);
}
try {
controller.kill();
} catch (Exception e) {
LOG.warn("Error during killing container. Will now attempt to uninstall the container.", e);
}
try {
controller.uninstall();
} catch (Exception e) {

}
model.deletePod(pod.getId());
}

Expand Down

0 comments on commit ed5bbf9

Please sign in to comment.