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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to