aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-main
diff options
context:
space:
mode:
authorEric Hartmann <hartmann.eric@gmail.com>2017-09-25 12:01:52 +0200
committerEric Hartmann <hartmann.eric@gmail.Com>2017-09-27 08:47:39 +0200
commit9045f371469ade40f42cc4a82fa9d9df95552a3c (patch)
treee92d3bba59810d707f95ba4cfe7ebc2c5bde98b6 /server/sonar-main
parenta84dc5bdd315df1d9ceceac7aac758f604b98320 (diff)
downloadsonarqube-9045f371469ade40f42cc4a82fa9d9df95552a3c.tar.gz
sonarqube-9045f371469ade40f42cc4a82fa9d9df95552a3c.zip
SONAR-9789 Display once a log message when waiting for ES to be up and running
Diffstat (limited to 'server/sonar-main')
-rw-r--r--server/sonar-main/src/main/java/org/sonar/application/SchedulerImpl.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/sonar-main/src/main/java/org/sonar/application/SchedulerImpl.java b/server/sonar-main/src/main/java/org/sonar/application/SchedulerImpl.java
index 8589e29414a..943f5de6efa 100644
--- a/server/sonar-main/src/main/java/org/sonar/application/SchedulerImpl.java
+++ b/server/sonar-main/src/main/java/org/sonar/application/SchedulerImpl.java
@@ -53,6 +53,7 @@ public class SchedulerImpl implements Scheduler, ProcessEventListener, ProcessLi
private final NodeLifecycle nodeLifecycle = new NodeLifecycle();
private final CountDownLatch keepAlive = new CountDownLatch(1);
+ private final AtomicBoolean firstWaitingEsLog = new AtomicBoolean(true);
private final AtomicBoolean restartRequested = new AtomicBoolean(false);
private final AtomicBoolean restartDisabled = new AtomicBoolean(false);
private final EnumMap<ProcessId, SQProcess> processesById = new EnumMap<>(ProcessId.class);
@@ -113,7 +114,13 @@ public class SchedulerImpl implements Scheduler, ProcessEventListener, ProcessLi
private void tryToStartWeb() {
SQProcess process = processesById.get(ProcessId.WEB_SERVER);
- if (process == null || !isEsClientStartable()) {
+ if (process == null) {
+ return;
+ }
+ if (!isEsClientStartable()) {
+ if (firstWaitingEsLog.getAndSet(false)) {
+ LOG.info("Waiting for Elasticsearch to be up and running");
+ }
return;
}
if (appState.isOperational(ProcessId.WEB_SERVER, false)) {