summaryrefslogtreecommitdiffstats
path: root/clustercontroller-apps
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2022-03-11 11:23:55 +0100
committerJon Marius Venstad <venstad@gmail.com>2022-03-11 11:23:55 +0100
commit3da3dca2a0ea9dbec9c1317f2b30c9bca2acfd82 (patch)
tree0f2084c8b30ec1a818a5003ff199cad8376cb245 /clustercontroller-apps
parent445f2b8f9b0a80fc6488c7095d5cd9ba8df51b43 (diff)
Ensure ClusterController shuts down before ZK cluster is uses
Diffstat (limited to 'clustercontroller-apps')
-rw-r--r--clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterController.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterController.java b/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterController.java
index 1eca2d18493..05daa43690c 100644
--- a/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterController.java
+++ b/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterController.java
@@ -11,6 +11,7 @@ import com.yahoo.vespa.clustercontroller.core.RemoteClusterControllerTaskSchedul
import com.yahoo.vespa.clustercontroller.core.restapiv2.ClusterControllerStateRestAPI;
import com.yahoo.vespa.clustercontroller.core.status.StatusHandler;
import com.yahoo.vespa.curator.Curator;
+import com.yahoo.vespa.zookeeper.Reconfigurer;
import com.yahoo.vespa.zookeeper.VespaZooKeeperServer;
import java.util.LinkedHashMap;
@@ -31,14 +32,19 @@ public class ClusterController extends AbstractComponent
private final Map<String, FleetController> controllers = new TreeMap<>();
private final Map<String, StatusHandler.ContainerStatusPageServer> status = new TreeMap<>();
+ ClusterController() {
+ this(null);
+ }
+
/**
* Dependency injection constructor for controller. A {@link VespaZooKeeperServer} argument is required
* for all its users, to ensure that zookeeper has started before we start polling it, but
* should not be injected here, as that causes recreation of the cluster controller, and old and new
* will run master election, etc., concurrently, which breaks everything.
+ * Instead, a {@link Reconfigurer} is injected to ensure this is shutdown before the ZK server owned by that.
*/
@Inject
- public ClusterController() {
+ public ClusterController(Reconfigurer unused) {
metricWrapper = new JDiscMetricWrapper(null);
}