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 2020/05/27 22:53:02 UTC

[GitHub] [helix] zhangmeng916 commented on a change in pull request #1033: Add path existing check for customized state

zhangmeng916 commented on a change in pull request #1033:
URL: https://github.com/apache/helix/pull/1033#discussion_r431487283



##########
File path: helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -1256,14 +1256,18 @@ protected void checkLiveInstancesObservation(List<LiveInstance> liveInstances,
 
         for (String instance : curInstances.keySet()) {
           if (lastInstances == null || !lastInstances.containsKey(instance)) {
-            try {
-              manager.addCustomizedStateRootChangeListener(this, instance);
-              logger.info(manager.getInstanceName() + " added customized root change listener for"
-                  + " " + instance
-                  + ", listener: " + this);
-            } catch (Exception e) {
-              logger.error("Fail to add customized root change listener for instance: " + instance,
-                  e);
+            PropertyKey propertyKey =
+                keyBuilder.customizedStatesRoot(instance);
+            if (propertyKey.getPath() != null) {

Review comment:
       oh..I was thinking to use exist checking, but put the wrong check, let me update it.
   This is just for backward incompatibility check. We're totally fine without this check, but the participant would need to be on the latest version to have customized state path created. If they don't, there can be some error logs when adding listener to customized state path. It's still fine, but might cause confusion.




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



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