mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
fix arthas-boot error when have _JAVA_OPTIONS env. #970
This commit is contained in:
@@ -101,21 +101,28 @@ public class ProcessUtils {
|
||||
|
||||
List<String> lines = ExecutingCommand.runNative(command);
|
||||
|
||||
AnsiLog.debug("jps result: " + lines);
|
||||
|
||||
int currentPid = Integer.parseInt(PidUtils.currentPid());
|
||||
for (String line : lines) {
|
||||
String[] strings = line.trim().split("\\s+");
|
||||
if (strings.length < 1) {
|
||||
continue;
|
||||
}
|
||||
int pid = Integer.parseInt(strings[0]);
|
||||
if (pid == currentPid) {
|
||||
continue;
|
||||
}
|
||||
if (strings.length >= 2 && isJpsProcess(strings[1])) { // skip jps
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
int pid = Integer.parseInt(strings[0]);
|
||||
if (pid == currentPid) {
|
||||
continue;
|
||||
}
|
||||
if (strings.length >= 2 && isJpsProcess(strings[1])) { // skip jps
|
||||
continue;
|
||||
}
|
||||
|
||||
result.put(pid, line);
|
||||
result.put(pid, line);
|
||||
} catch (Throwable e) {
|
||||
// https://github.com/alibaba/arthas/issues/970
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user