From 2e5f81f8ce0749ba8033aad61b15894797d0d994 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 28 Aug 2014 11:12:42 +0200 Subject: [PATCH] SONAR-4898 do not remove the autokill monitor before trying to stop app --- .../java/org/sonar/process/MonitoredProcess.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; } -- 2.39.5