[agent][executor]- bug - 2
This commit is contained in:
@@ -205,12 +205,16 @@ public class CommandExecutor {
|
|||||||
if (process.isAlive()) {
|
if (process.isAlive()) {
|
||||||
// shutdown the process
|
// shutdown the process
|
||||||
log.debug(
|
log.debug(
|
||||||
"开始销毁命令[ {} ]执行进程!",
|
"开始销毁命令 [ {} ] 执行进程!",
|
||||||
process
|
process
|
||||||
.info()
|
.info()
|
||||||
.commandLine()
|
.commandLine()
|
||||||
.get()
|
.get()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 对线程进行debug
|
||||||
|
commandExecLogCache.debugProcessStreams(process);
|
||||||
|
|
||||||
process.destroy();
|
process.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,6 +104,42 @@ public class CommandExecLogCache {
|
|||||||
return execLogCacheArrayList;
|
return execLogCacheArrayList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调试打印process哥各个 流
|
||||||
|
*
|
||||||
|
* @param process
|
||||||
|
*/
|
||||||
|
public void debugProcessStreams(Process process) {
|
||||||
|
|
||||||
|
log.debug(
|
||||||
|
"开始对一个process进行debug操作,process的信息为 {}, 执行时间为 {} , 执行结果为 {}",
|
||||||
|
process
|
||||||
|
.info()
|
||||||
|
.commandLine(),
|
||||||
|
process
|
||||||
|
.info()
|
||||||
|
.totalCpuDuration()
|
||||||
|
.get(),
|
||||||
|
process.exitValue()
|
||||||
|
);
|
||||||
|
|
||||||
|
log.debug("------------- inputStream -----------");
|
||||||
|
new BufferedReader(new InputStreamReader(process.getInputStream()))
|
||||||
|
.lines()
|
||||||
|
.forEach(
|
||||||
|
System.out::println
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
log.debug("------------- errorStream -----------");
|
||||||
|
new BufferedReader(new InputStreamReader(process.getErrorStream()))
|
||||||
|
.lines()
|
||||||
|
.forEach(
|
||||||
|
System.out::println
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实际执行命令缓存操作
|
* 实际执行命令缓存操作
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user