mattisonchao commented on code in PR #17700:
URL: https://github.com/apache/pulsar/pull/17700#discussion_r973535614


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/coordination/impl/ResourceLockImpl.java:
##########
@@ -232,6 +217,23 @@ synchronized CompletableFuture<Void> revalidate(T 
newValue) {
             });
             revalidateFuture = newFuture;
         }
+        revalidateFuture.exceptionally(ex -> {
+            Throwable realCause = FutureUtil.unwrapCompletionException(ex);
+            synchronized (ResourceLockImpl.this) {
+                if (realCause instanceof BadVersionException || realCause 
instanceof LockBusyException) {
+                    log.warn("Failed to revalidate the lock at {}. Marked as 
expired", path);
+                    state = State.Released;
+                    expiredFuture.complete(null);
+                } else {
+                    // We failed to revalidate the lock due to connectivity 
issue
+                    // Continue assuming we hold the lock, until we can 
revalidate it, either
+                    // on Reconnected or SessionReestablished events.
+                    log.warn("Failed to revalidate the lock at {}. Retrying 
later on reconnection {}", path,

Review Comment:
   there may lost update `revalidateAfterReconnection`, the fix PR #17664



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

Reply via email to