liangyepianzhou commented on a change in pull request #13348:
URL: https://github.com/apache/pulsar/pull/13348#discussion_r776747371
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionImpl.java
##########
@@ -148,8 +152,32 @@ public synchronized void
registerSendOp(CompletableFuture<MessageId> sendFuture)
}
}
+ public synchronized <T> void registerInternal(CompletableFuture<T>
completableFuture) {
+ //There have been an exception, it means this transaction should not
be commit,
+ //so there is no need to record the execution of other operations
+ if (!executedFuture.isCompletedExceptionally()) {
+ opsExecutingInTxn.incrementAndGet();
+ executedFuture = new CompletableFuture<>();
+ completableFuture.thenRun(() -> {
+ synchronized (this) {
Review comment:
`executedFuture = new CompletableFuture<>();`,
`executedFuture.complete(null);` and `executedFuture.completeExceptionally`
should be exclusive.
--
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]