You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2022/04/04 21:27:54 UTC

[GitHub] [helix] qqu0127 commented on a diff in pull request #2005: Populate helix cloud property using cloud config

qqu0127 commented on code in PR #2005:
URL: https://github.com/apache/helix/pull/2005#discussion_r842154584


##########
helix-core/src/main/java/org/apache/helix/HelixPropertyFactory.java:
##########
@@ -113,10 +109,10 @@ public static CloudConfig getCloudConfig(String zkAddress, String clusterName) {
       // The try-catch logic is for backward compatibility reason only. Even if the cluster is not set
       // up yet, constructing a new ZKHelixManager should not throw an exception
       try {
-        cloudConfig = configAccessor.getCloudConfig(clusterName) == null ? buildEmptyCloudConfig()
+        cloudConfig = configAccessor.getCloudConfig(clusterName) == null ? new CloudConfig()
             : configAccessor.getCloudConfig(clusterName);

Review Comment:
   This queries cloudConfig twice, and not atomic... Can we assign it with `configAccessor.getCloudConfig(clusterName)` first and then do null check? 
   (sorry I missed this one in the first pass)



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org