You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/08/15 10:00:59 UTC
[GitHub] [skywalking] kezhenxu94 commented on a change in pull request
#3273: Support Zookeeper ACL
kezhenxu94 commented on a change in pull request #3273: Support Zookeeper ACL
URL: https://github.com/apache/skywalking/pull/3273#discussion_r314246288
##########
File path: oap-server/server-cluster-plugin/cluster-zookeeper-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/zookeeper/ClusterModuleZookeeperProvider.java
##########
@@ -61,7 +79,39 @@ public ClusterModuleZookeeperProvider() {
@Override public void prepare() throws ServiceNotProvidedException, ModuleStartException {
RetryPolicy retryPolicy = new ExponentialBackoffRetry(config.getBaseSleepTimeMs(), config.getMaxRetries());
- client = CuratorFrameworkFactory.newClient(config.getHostPort(), retryPolicy);
+
+ CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
+ .retryPolicy(retryPolicy)
+ .connectString(config.getHostPort());
+ if (config.isEnableACL()) {
+ final List<ACL> acls = Lists.newArrayList();
+
+ String authInfo = config.getAuth();
+ if ("digest".equals(config.getSchema())) {
+ try {
+ authInfo = DigestAuthenticationProvider.generateDigest(authInfo);
+ } catch (NoSuchAlgorithmException e) {
+ logger.error(e.getMessage(), e);
Review comment:
Although it hardly throws, I think wrapping it with `ModuleStartException` and re-throwing it should be better to fast fail
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services