codelipenghui commented on code in PR #18235:
URL: https://github.com/apache/pulsar/pull/18235#discussion_r1007782116


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKMetadataStore.java:
##########
@@ -206,6 +203,14 @@ private void existsFromStoreInternal(String path, 
CompletableFuture<Boolean> fut
                     if (code == Code.OK) {
                         future.complete(true);
                     } else if (code == Code.NONODE) {
+                        // remove watcher if node does not exist
+                        zkc.removeAllWatches(path, Watcher.WatcherType.Any, 
true,
+                                (rc0, path0, ctx0) -> {
+                                    Code code0 = Code.get(rc0);
+                                    if (code0 != Code.OK && code0 != 
Code.NOWATCHER) {
+                                        log.warn("Remove watcher failed. rc: 
{}, path: {}", code0, path);

Review Comment:
   Please check all.



##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKMetadataStore.java:
##########
@@ -206,6 +203,14 @@ private void existsFromStoreInternal(String path, 
CompletableFuture<Boolean> fut
                     if (code == Code.OK) {
                         future.complete(true);
                     } else if (code == Code.NONODE) {
+                        // remove watcher if node does not exist
+                        zkc.removeAllWatches(path, Watcher.WatcherType.Any, 
true,
+                                (rc0, path0, ctx0) -> {
+                                    Code code0 = Code.get(rc0);
+                                    if (code0 != Code.OK && code0 != 
Code.NOWATCHER) {
+                                        log.warn("Remove watcher failed. rc: 
{}, path: {}", code0, path);

Review Comment:
   ```suggestion
                                           log.warn("Remove watcher for 
non-existing znode failed. rc: {}, path: {}", code0, path);
   ```



-- 
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: commits-unsubscr...@pulsar.apache.org

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

Reply via email to