[agent][executor]- bug - 8
This commit is contained in:
@@ -19,6 +19,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
@@ -227,7 +228,32 @@ public class CommandExecutor {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
process.destroy();
|
||||
//process.destroy();
|
||||
try {
|
||||
|
||||
byte[] bytes = process
|
||||
.getInputStream()
|
||||
.readAllBytes();
|
||||
|
||||
String s = new String(
|
||||
bytes,
|
||||
StandardCharsets.UTF_8
|
||||
);
|
||||
|
||||
log.debug(
|
||||
"从process中获取到的 所有字符内容为 {}",
|
||||
s
|
||||
);
|
||||
|
||||
// 关闭这个命令执行的inputStream
|
||||
process
|
||||
.getInputStream()
|
||||
.close();
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
try {
|
||||
Process exitProcess = process
|
||||
|
||||
@@ -54,7 +54,6 @@ public class CommandExecLogCache {
|
||||
process
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user