From f1caa8a6c07a1362ab27d3eacc16ee99b98903b7 Mon Sep 17 00:00:00 2001 From: Stephan Krusche Date: Fri, 29 Nov 2024 13:40:18 +0100 Subject: [PATCH] Development: Improve error logs when unresponsive build containers cannot be stopped --- .../buildagent/service/BuildJobContainerService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobContainerService.java b/src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobContainerService.java index b6f4c63019da..cfe5a1ab01e3 100644 --- a/src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobContainerService.java +++ b/src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobContainerService.java @@ -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 { @@ -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 {