diff --git a/meta-client/src/main/java/org/apache/helix/metaclient/recipes/leaderelection/LeaderElectionClient.java b/meta-client/src/main/java/org/apache/helix/metaclient/recipes/leaderelection/LeaderElectionClient.java index 373d360132..ae7d9c9fab 100644 --- a/meta-client/src/main/java/org/apache/helix/metaclient/recipes/leaderelection/LeaderElectionClient.java +++ b/meta-client/src/main/java/org/apache/helix/metaclient/recipes/leaderelection/LeaderElectionClient.java @@ -97,7 +97,13 @@ public LeaderElectionClient(MetaClientConfig metaClientConfig, String participan LOG.info("Creating MetaClient for LeaderElectionClient"); if (MetaClientConfig.StoreType.ZOOKEEPER.equals(metaClientConfig.getStoreType())) { ZkMetaClientConfig zkMetaClientConfig = new ZkMetaClientConfig.ZkMetaClientConfigBuilder().setConnectionAddress( - metaClientConfig.getConnectionAddress()).setZkSerializer((new LeaderInfoSerializer())).build(); + metaClientConfig.getConnectionAddress()) + .setZkSerializer((new LeaderInfoSerializer())) + .setSessionTimeoutInMillis(metaClientConfig.getSessionTimeoutInMillis()) + .setMetaClientReconnectPolicy(metaClientConfig.getMetaClientReconnectPolicy()) + .setConnectionInitTimeoutInMillis(metaClientConfig.getConnectionInitTimeoutInMillis()) + .setAuthEnabled(metaClientConfig.isAuthEnabled()) + .build(); _metaClient = new ZkMetaClientFactory().getMetaClient(zkMetaClientConfig); _metaClient.connect(); _metaClient.subscribeStateChanges(_connectStateListener);