tomscut commented on a change in pull request #11965:
URL: https://github.com/apache/pulsar/pull/11965#discussion_r722940221



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
##########
@@ -2021,7 +2020,12 @@ public void asyncDelete(Iterable<Position> positions, 
AsyncCallbacks.DeleteCallb
             callback.deleteFailed(getManagedLedgerException(e), ctx);
             return;
         } finally {
-            lock.writeLock().unlock();
+            if (individualDeletedMessages.isEmpty()) {

Review comment:
       Good catch. Can we change the code to something like this:
   ```
   finally {
       lock.writeLock().unlock();
       if (individualDeletedMessages.isEmpty()) {
           callback.deleteComplete(ctx);
       }
   }
   ```




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