]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4898 - fix early termination leaves search server as ghost
authorStephane Gamard <stephane.gamard@sonarsource.com>
Fri, 29 Aug 2014 10:21:57 +0000 (12:21 +0200)
committerStephane Gamard <stephane.gamard@sonarsource.com>
Fri, 29 Aug 2014 10:22:06 +0000 (12:22 +0200)
sonar-application/src/main/java/org/sonar/application/App.java

index e4c5abcac513817af7208174d703d3a2b2e54101..eb7433f83dc59bdba8d5dcb8335e61e270ff20ae 100644 (file)
@@ -126,11 +126,6 @@ public class App implements ProcessMXBean {
 
   @Override
   public void terminate() {
-    if (monitor != null && monitor.isAlive()) {
-      monitor.terminate();
-      monitor.interrupt();
-      monitor = null;
-    }
     if (server != null) {
       server.terminate();
       server = null;
@@ -139,6 +134,11 @@ public class App implements ProcessMXBean {
       elasticsearch.terminate();
       elasticsearch = null;
     }
+    if (monitor != null && monitor.isAlive()) {
+      monitor.terminate();
+      monitor.interrupt();
+      monitor = null;
+    }
   }
 
   private boolean isSuccess() {