From 48b3bf28c3007d549892eebd0fc6a18707c0d2c0 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 12 Sep 2014 12:35:33 +0200 Subject: [PATCH] SONAR-4898 add debug logs --- .../main/java/org/sonar/process/ProcessEntryPoint.java | 1 + .../src/main/java/org/sonar/search/SearchServer.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java index 79ec79f74b7..6990545a571 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java +++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java @@ -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; } diff --git a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java index 6e5a366ff64..cf7eb1682df 100644 --- a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java +++ b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java @@ -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(); + } + } } } -- 2.39.5