Skip to content

Commit

Permalink
Development: Improve error logs when unresponsive build containers ca…
Browse files Browse the repository at this point in the history
…nnot be stopped
  • Loading branch information
krusche committed Nov 29, 2024
1 parent ca1beca commit f1caa8a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ public void stopUnresponsiveContainer(String containerId) {
future.get(10, TimeUnit.SECONDS); // Wait for the stop command to complete with a timeout
}
catch (NotFoundException | NotModifiedException e) {
log.debug("Container with id {} is already stopped: {}", containerId, e.getMessage());
log.warn("Container with id {} is already stopped.", containerId, e);
}
catch (Exception e) {
log.warn("Failed to stop container with id {}. Attempting to kill container: {}", containerId, e.getMessage());
log.error("Failed to stop container with id {}. Attempting to kill container.", containerId, e);

// Attempt to kill the container if stop fails
try {
Expand All @@ -236,7 +236,7 @@ public void stopUnresponsiveContainer(String containerId) {
killFuture.get(5, TimeUnit.SECONDS); // Wait for the kill command to complete with a timeout
}
catch (Exception killException) {
log.warn("Failed to kill container with id {}: {}", containerId, killException.getMessage());
log.error("Failed to kill container with id {}.", containerId, killException);
}
}
finally {
Expand Down

0 comments on commit f1caa8a

Please sign in to comment.