]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4898 add debug logs
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 12 Sep 2014 10:35:33 +0000 (12:35 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 12 Sep 2014 10:35:33 +0000 (12:35 +0200)
server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java
server/sonar-search/src/main/java/org/sonar/search/SearchServer.java

index 79ec79f74b75188701077da383a5c6a61b5b5a5f..6990545a5710df51536e2adb1d58e9ffbead8e9a 100644 (file)
@@ -86,6 +86,7 @@ public class ProcessEntryPoint implements ProcessMXBean {
 
   @Override
   public boolean isReady() {
+    LoggerFactory.getLogger(getClass()).warn("Received JMX request isReady: " + (lifecycle.getState() == State.STARTED));
     return lifecycle.getState() == State.STARTED;
   }
 
index 6e5a366ff644ee6c7a2dd9e71b82bc5ee87de943..cf7eb1682df8c1bd66646f9d9365fe3528d963e8 100644 (file)
@@ -143,6 +143,16 @@ public class SearchServer implements MonitoredProcess {
         .setTemplate("*")
         .addMapping("_default_", "{\"dynamic\": \"strict\"}")
         .get();
+
+      boolean ready = false;
+      while (!ready) {
+        ready = isReady();
+        try {
+          Thread.sleep(300L);
+        } catch (InterruptedException e) {
+          e.printStackTrace();
+        }
+      }
     }
   }