mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-24 13:15:06 +00:00
Killed or crashed daemon process kept in the registry until mvnd --stop is called #154
This commit is contained in:
@@ -154,13 +154,20 @@ public class DefaultClient implements Client {
|
|||||||
final String template = " %36s %7s %5s %7s %5s %23s %s";
|
final String template = " %36s %7s %5s %7s %5s %23s %s";
|
||||||
output.accept(null, String.format(template,
|
output.accept(null, String.format(template,
|
||||||
"UUID", "PID", "Port", "Status", "RSS", "Last activity", "Java home"));
|
"UUID", "PID", "Port", "Status", "RSS", "Last activity", "Java home"));
|
||||||
registry.getAll().forEach(d -> output.accept(null, String.format(template,
|
for (DaemonInfo d : registry.getAll()) {
|
||||||
d.getUid(), d.getPid(), d.getAddress(), d.getState(),
|
if (ProcessHandle.of(d.getPid()).isEmpty()) {
|
||||||
OsUtils.kbTohumanReadable(OsUtils.findProcessRssInKb(d.getPid())),
|
/* The process does not exist anymore - remove it from the registry */
|
||||||
LocalDateTime.ofInstant(
|
registry.remove(d.getUid());
|
||||||
Instant.ofEpochMilli(Math.max(d.getLastIdle(), d.getLastBusy())),
|
} else {
|
||||||
ZoneId.systemDefault()),
|
output.accept(null, String.format(template,
|
||||||
d.getJavaHome())));
|
d.getUid(), d.getPid(), d.getAddress(), d.getState(),
|
||||||
|
OsUtils.kbTohumanReadable(OsUtils.findProcessRssInKb(d.getPid())),
|
||||||
|
LocalDateTime.ofInstant(
|
||||||
|
Instant.ofEpochMilli(Math.max(d.getLastIdle(), d.getLastBusy())),
|
||||||
|
ZoneId.systemDefault()),
|
||||||
|
d.getJavaHome()));
|
||||||
|
}
|
||||||
|
}
|
||||||
return new DefaultResult(argv, null);
|
return new DefaultResult(argv, null);
|
||||||
}
|
}
|
||||||
boolean stop = args.remove("--stop");
|
boolean stop = args.remove("--stop");
|
||||||
|
Reference in New Issue
Block a user