Skip to content

Commit

Permalink
[Fix][Txn] Unwrap the completion exception. (#20396)
Browse files Browse the repository at this point in the history
  • Loading branch information
thetumbled authored May 30, 2023
1 parent a26cf3e commit 7ea8741
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ public CompletableFuture<Void> handleTcClientConnect(TransactionCoordinatorID tc
tcLoadSemaphore.release();
})).exceptionally(e -> {
internalPinnedExecutor.execute(() -> {
completableFuture.completeExceptionally(e.getCause());
Throwable realCause = FutureUtil.unwrapCompletionException(e);
completableFuture.completeExceptionally(realCause);
// release before handle request queue,
//in order to client reconnect infinite loop
tcLoadSemaphore.release();
Expand All @@ -180,7 +181,7 @@ public CompletableFuture<Void> handleTcClientConnect(TransactionCoordinatorID tc
CompletableFuture<Void> future = deque.poll();
if (future != null) {
// this means that this tc client connection connect fail
future.completeExceptionally(e);
future.completeExceptionally(realCause);
} else {
break;
}
Expand Down

0 comments on commit 7ea8741

Please sign in to comment.