[agent][executor]- bug - 2
This commit is contained in:
@@ -166,7 +166,7 @@ public class CommandExecutor {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
log.debug(
|
log.debug(
|
||||||
"[ {} ]命令执行守护进程开始等待 {} s for the result",
|
"[ {} ] 命令执行守护进程开始等待 {} 秒",
|
||||||
process
|
process
|
||||||
.info()
|
.info()
|
||||||
.commandLine()
|
.commandLine()
|
||||||
@@ -184,11 +184,7 @@ public class CommandExecutor {
|
|||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
// 缓存 命令处理日志
|
|
||||||
commandExecLogCache.cacheLog(
|
|
||||||
streamKey,
|
|
||||||
process
|
|
||||||
);
|
|
||||||
|
|
||||||
// 任务提前执行结束,或者超过了最长等待时间
|
// 任务提前执行结束,或者超过了最长等待时间
|
||||||
// 判断命令是否正确处理完成
|
// 判断命令是否正确处理完成
|
||||||
@@ -201,8 +197,23 @@ public class CommandExecutor {
|
|||||||
.get(),
|
.get(),
|
||||||
commandExecWaitTimeout
|
commandExecWaitTimeout
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// 命令没有正确的处理完成,需要手动关停程序
|
||||||
|
// 只有当该进程还存活,执行关闭操作
|
||||||
|
if (process.isAlive()) {
|
||||||
|
// shutdown the process
|
||||||
|
log.debug("开始销毁命令执行进程!");
|
||||||
|
process.destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 缓存 命令处理日志
|
||||||
|
commandExecLogCache.cacheLog(
|
||||||
|
streamKey,
|
||||||
|
process
|
||||||
|
);
|
||||||
|
|
||||||
// 日志操作,如果需要显示回传,需要将日志发送回相应的
|
// 日志操作,如果需要显示回传,需要将日志发送回相应的
|
||||||
collectCommandLogAndRepeat(
|
collectCommandLogAndRepeat(
|
||||||
streamKey,
|
streamKey,
|
||||||
@@ -210,13 +221,6 @@ public class CommandExecutor {
|
|||||||
octopusMessage
|
octopusMessage
|
||||||
);
|
);
|
||||||
|
|
||||||
// 只有当该进程还存活,执行关闭操作
|
|
||||||
if (process.isAlive()) {
|
|
||||||
// shutdown the process
|
|
||||||
log.debug("开始销毁命令执行进程!");
|
|
||||||
process.destroyForcibly();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user