From: Simon Brandhof Date: Thu, 28 Aug 2014 09:12:42 +0000 (+0200) Subject: SONAR-4898 do not remove the autokill monitor before trying to stop app X-Git-Tag: 4.5-RC1~59 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2e5f81f8ce0749ba8033aad61b15894797d0d994;p=sonarqube.git SONAR-4898 do not remove the autokill monitor before trying to stop app --- diff --git a/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java b/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java index 5f0c03bea7a..c36df449b9e 100644 --- a/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java +++ b/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java @@ -126,18 +126,18 @@ public abstract class MonitoredProcess implements ProcessMXBean { public final void terminate() { if (monitor != null) { LOGGER.debug("Process[{}] terminating", name); - monitor.shutdownNow(); - monitor = null; - if (pingTask != null) { - pingTask.cancel(true); - pingTask = null; - } try { doTerminate(); } catch (Exception e) { LOGGER.error("Fail to terminate " + name, e); // do not propagate exception } + monitor.shutdownNow(); + monitor = null; + if (pingTask != null) { + pingTask.cancel(true); + pingTask = null; + } LOGGER.debug("Process[{}] terminated", name); terminated = true; }