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/04/01 04:12:14 UTC

[GitHub] [pulsar] HQebupt commented on a change in pull request #14973: [fix][transaction] Fix potentially unfinished CompletableFuture.

HQebupt commented on a change in pull request #14973:
URL: https://github.com/apache/pulsar/pull/14973#discussion_r840214328



##########
File path: pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionMetadataStore.java
##########
@@ -257,7 +257,7 @@ public void handleMetadataEntry(Position position, TransactionMetadataEntry tran
                         State.Ready, getState(), "add produced partition"));
                 return;
             }
-            getTxnPositionPair(txnID).thenAccept(txnMetaListPair -> {
+            getTxnPositionPair(txnID).thenCompose(txnMetaListPair -> {

Review comment:
       The origin method `getTxnPositionPair(txnID)` may throw TransactionNotFoundException, but it does not catch it. It may cause the uncompleted future. LGTM




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