From 059a9385e904b66e168082c53df964c7704ba2b0 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Thu, 29 Feb 2024 14:03:30 +0200 Subject: [PATCH] Fix delete temp console pipe log files after Task execution is completed. This is important for long lasting services agents, avoiding collecting temp files on host machine --- clearml_agent/commands/worker.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clearml_agent/commands/worker.py b/clearml_agent/commands/worker.py index fd61ce9..adbcd3c 100644 --- a/clearml_agent/commands/worker.py +++ b/clearml_agent/commands/worker.py @@ -2033,6 +2033,11 @@ class Worker(ServiceCommandSection): if stop_signal and stop_signal.was_abort_function_called(status): stop_reason = TaskStopReason.stopped + # now we delete the temp files + safe_remove_file(stdout_path) + if stderr_path: + safe_remove_file(stdout_path) + return status, stop_reason def _check_if_internal_agent_started(self, printed_lines, service_mode_internal_agent_started, task_id):