From 868ff8e2b71d3b7890621f8fb565ff87b0bb0ab6 Mon Sep 17 00:00:00 2001 From: zeaslity Date: Sun, 26 Feb 2023 14:49:46 +0800 Subject: [PATCH] [agent][executor]- bug - 10 --- .../main/java/io/wdd/agent/executor/CommandExecutor.java | 5 +++-- .../io/wdd/agent/executor/thread/CommandExecLogCache.java | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java b/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java index 55a2aa9..646911d 100644 --- a/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java +++ b/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java @@ -202,11 +202,12 @@ public class CommandExecutor { "开始销毁命令 [ {} ] 执行进程!", process .info() - .commandLine() - .get() ); } + // 打印一下 debug + commandExecLogCache.PrintCommandCachedLog(streamKey); + // 关停任务执行的缓存日志收集 BufferedReader 否则无法终止 commandExecLogCache.StopExecLogBufferedReader( streamKey, diff --git a/agent/src/main/java/io/wdd/agent/executor/thread/CommandExecLogCache.java b/agent/src/main/java/io/wdd/agent/executor/thread/CommandExecLogCache.java index ce54e3c..2335444 100644 --- a/agent/src/main/java/io/wdd/agent/executor/thread/CommandExecLogCache.java +++ b/agent/src/main/java/io/wdd/agent/executor/thread/CommandExecLogCache.java @@ -168,8 +168,8 @@ public class CommandExecLogCache { inputStreamReader ); - if (ObjectUtils.isNotEmpty(bufferedReader)) { - try { + + try { // 关闭command的输出流 process @@ -183,7 +183,7 @@ public class CommandExecLogCache { } catch (IOException e) { throw new RuntimeException(e); } - } + }