jiajunwang commented on a change in pull request #1344:
URL: https://github.com/apache/helix/pull/1344#discussion_r489690588
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/CallbackHandler.java
##########
@@ -646,10 +652,14 @@ private void subscribeForChanges(NotificationContext.Type
callbackType, String p
break;
}
default: {
- List<String> childNames = _zkClient.getChildren(path);
- if (childNames != null) {
- for (String childName : childNames) {
- String childPath = path + "/" + childName;
+ // When callback type is FINALIZE, subscribeChildChange doesn't
+ // get children list. We need to read children to unsubscribe
data change listeners.
+ if (callbackType == Type.FINALIZE) {
+ children = _zkClient.getChildren(path);
+ }
Review comment:
As we discussed, I think this check is not necessary. The later check
for children != null is good enough.
If the node was not created and then create during this callback processing,
then we will have another callback to process the event since the watcher has
been added.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]