[agent][executor]- bug - 7
This commit is contained in:
@@ -252,13 +252,10 @@ public class CommandExecutor {
|
|||||||
octopusMessage
|
octopusMessage
|
||||||
);*/
|
);*/
|
||||||
|
|
||||||
// 执行到这里,说明整个任务流程结束
|
// 执行到这里,说明整个任务流程结束(超时结束)
|
||||||
log.debug(
|
log.debug(
|
||||||
"命令 [ {} ] 执行全流程结束!",
|
"命令 [ {} ] 执行全流程结束!",
|
||||||
process
|
process
|
||||||
.info()
|
|
||||||
.commandLine()
|
|
||||||
.get()
|
|
||||||
);
|
);
|
||||||
if (process.isAlive()) {
|
if (process.isAlive()) {
|
||||||
// shutdown the process
|
// shutdown the process
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package io.wdd.agent.executor.thread;
|
package io.wdd.agent.executor.thread;
|
||||||
|
|
||||||
|
|
||||||
import io.wdd.agent.config.utils.AgentCommonThreadPool;
|
|
||||||
import io.wdd.common.handler.MyRuntimeException;
|
import io.wdd.common.handler.MyRuntimeException;
|
||||||
import io.wdd.common.utils.TimeUtils;
|
import io.wdd.common.utils.TimeUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -22,13 +21,12 @@ import java.util.HashMap;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class CommandExecLogCache {
|
public class CommandExecLogCache {
|
||||||
|
|
||||||
// 存储命令执行缓存日志
|
|
||||||
public static HashMap<String, ArrayList<String>> CachedCommandLogMap = new HashMap<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储命令执行为空的默认空结果
|
* 存储命令执行为空的默认空结果
|
||||||
*/
|
*/
|
||||||
private static final ArrayList<String> EmptyCommandLog = new ArrayList<>();
|
private static final ArrayList<String> EmptyCommandLog = new ArrayList<>();
|
||||||
|
// 存储命令执行缓存日志
|
||||||
|
public static HashMap<String, ArrayList<String>> CachedCommandLogMap = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缓存命令执行日志
|
* 缓存命令执行日志
|
||||||
@@ -50,14 +48,13 @@ public class CommandExecLogCache {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// 这里需要采用异步的方式执行
|
// 这里需要采用异步的方式执行
|
||||||
AgentCommonThreadPool.pool.submit(
|
// cache the real command logs
|
||||||
() -> // cache the real command logs
|
doCacheLog(
|
||||||
doCacheLog(
|
streamKey,
|
||||||
streamKey,
|
process
|
||||||
process
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -146,12 +143,6 @@ public class CommandExecLogCache {
|
|||||||
commandCachedLog.add("--------------- command result are as below --------------------");
|
commandCachedLog.add("--------------- command result are as below --------------------");
|
||||||
commandCachedLog.add("");
|
commandCachedLog.add("");
|
||||||
|
|
||||||
log.debug(
|
|
||||||
"命令执行结果头信息操作完成,内容为 {}",
|
|
||||||
commandCachedLog
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
log.debug("doCacheLog 开始从process的结果中获取日志缓存");
|
log.debug("doCacheLog 开始从process的结果中获取日志缓存");
|
||||||
|
|
||||||
// read from input stream and store to the cacheArrayList
|
// read from input stream and store to the cacheArrayList
|
||||||
|
|||||||
Reference in New Issue
Block a user