aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-ce
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-10-09 14:59:38 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-10-10 15:03:22 +0200
commit3bcf9ea40fe7dc563a1c8e438c0f6e3b5226466d (patch)
tree3e4bac1cd0c2e301efc7b044ffebc33712e09fb5 /server/sonar-ce
parent37915e1548b5a706b0aed606ee3250e3496850b0 (diff)
downloadsonarqube-3bcf9ea40fe7dc563a1c8e438c0f6e3b5226466d.tar.gz
sonarqube-3bcf9ea40fe7dc563a1c8e438c0f6e3b5226466d.zip
fix wrong "ce started" log after ce startup failure
Diffstat (limited to 'server/sonar-ce')
-rw-r--r--server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java b/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java
index f36ff2c2251..1a7ecf8250f 100644
--- a/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java
+++ b/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java
@@ -80,7 +80,7 @@ public class CeServer implements Monitored {
checkState(ceMainThread != null, "getStatus() can not be called before start()");
if (ceMainThread.isStarted()) {
- return Status.OPERATIONAL;
+ return ceMainThread.isOperational() ? Status.OPERATIONAL : Status.FAILED;
}
return Status.DOWN;
}
@@ -130,6 +130,7 @@ public class CeServer implements Monitored {
private static final int CHECK_FOR_STOP_DELAY = 50;
private volatile boolean stop = false;
private volatile boolean started = false;
+ private volatile boolean operational = false;
public CeMainThread() {
super(CE_MAIN_THREAD_NAME);
@@ -138,6 +139,7 @@ public class CeServer implements Monitored {
@Override
public void run() {
boolean startupSuccessful = attemptStartup();
+ this.operational = startupSuccessful;
this.started = true;
if (startupSuccessful) {
// call below is blocking
@@ -196,6 +198,10 @@ public class CeServer implements Monitored {
return started;
}
+ public boolean isOperational() {
+ return operational;
+ }
+
public void stopIt() {
// stop looping indefinitely
this.stop = true;