aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-07-18 12:37:21 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-07-18 12:38:09 +0200
commitdd181b05b0434264b3bcf3bd0bf5064fd261b820 (patch)
treec8a1d4e6a3c6e1f12b1957f88d894fde8673ad3b /server
parent53dfc28036238e9ac07cfa90ff29ee60ee00edbb (diff)
downloadsonarqube-dd181b05b0434264b3bcf3bd0bf5064fd261b820.tar.gz
sonarqube-dd181b05b0434264b3bcf3bd0bf5064fd261b820.zip
SONAR-5408 - ESNode is in a "transition" state. Must take care of client and node.
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java b/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java
index b6334873455..02e8490432d 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java
@@ -60,6 +60,7 @@ public class ESNode implements Startable {
// available only after startup
private Client client;
+ private Node node;
public ESNode(ServerFileSystem fileSystem, Settings settings) {
this(fileSystem, settings, DEFAULT_HEALTH_TIMEOUT);
@@ -107,7 +108,7 @@ public class ESNode implements Startable {
initRestConsole(esSettings);
initNetwork(esSettings);
- Node node = NodeBuilder.nodeBuilder()
+ node = NodeBuilder.nodeBuilder()
.settings(esSettings)
.node();
node.start();
@@ -258,6 +259,10 @@ public class ESNode implements Startable {
client.close();
client = null;
}
+ if (node != null) {
+ node.close();
+ node = null;
+ }
}
public Client client() {