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


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionImpl.java:
##########
@@ -123,8 +125,23 @@ public CompletableFuture<Void> 
registerProducedTopic(String topic) {
         return completableFuture;
     }
 
-    public synchronized void registerSendOp(CompletableFuture<MessageId> 
sendFuture) {
-        sendFutureList.add(sendFuture);
+    public void registerSendOp(CompletableFuture<MessageId> newSendFuture) {
+        if (OP_COUNT_UPDATE.getAndIncrement(this) == 0) {
+            opFuture = new CompletableFuture<>();

Review Comment:
   If the transaction has three ops, and all of the ops are completed.
   
   Then a new op happened on this transaction, we will miss the new op, right?
   Because the user can able to commit or abort the transaction without waiting 
the last op.



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