You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/19 22:33:03 UTC

[GitHub] [pulsar] nicoloboschi commented on a diff in pull request #18989: [fix][broker] Fix deadlock in PendingAckHandleImpl

nicoloboschi commented on code in PR #18989:
URL: https://github.com/apache/pulsar/pull/18989#discussion_r1052696221


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:
##########
@@ -937,19 +937,24 @@ public TransactionPendingAckStats getStats(boolean lowWaterMarks) {
         return transactionPendingAckStats;
     }
 
-    public synchronized void completeHandleFuture() {
-        if (!this.pendingAckHandleCompletableFuture.isDone()) {
-            this.pendingAckHandleCompletableFuture.complete(PendingAckHandleImpl.this);
-        }
-        if (recoverTime.getRecoverStartTime() != 0L) {
-            recoverTime.setRecoverEndTime(System.currentTimeMillis());
+    public void completeHandleFuture() {
+        synchronized (this.pendingAckHandleCompletableFuture) {

Review Comment:
   the getter escapes on purpose but I agree we don't need the synchronized at all here



-- 
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-unsubscribe@pulsar.apache.org

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