nicoloboschi commented on code in PR #18989: URL: https://github.com/apache/pulsar/pull/18989#discussion_r1053032593
########## pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java: ########## @@ -937,18 +937,16 @@ public TransactionPendingAckStats getStats(boolean lowWaterMarks) { return transactionPendingAckStats; } - public synchronized void completeHandleFuture() { - if (!this.pendingAckHandleCompletableFuture.isDone()) { - this.pendingAckHandleCompletableFuture.complete(PendingAckHandleImpl.this); - } - if (recoverTime.getRecoverStartTime() != 0L) { + public void completeHandleFuture() { + this.pendingAckHandleCompletableFuture.complete(PendingAckHandleImpl.this); + if (recoverTime.getRecoverStartTime() != 0L && recoverTime.getRecoverEndTime() == 0L) { recoverTime.setRecoverEndTime(System.currentTimeMillis()); Review Comment: You're totally right. This `recoveryTime` registers the time of the replay. It should be handled directly in the callback after the replay is completed. For the current usage, being non thread-safe is fine and I'd prefer leave it as is. Those methods doesn't need synchronization at all since, at the moment, there's no data race for them. -- 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