Skip to content

Commit

Permalink
[Fix][Txn] Unwrap the completion exception. (#20396)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7ea8741)
  • Loading branch information
thetumbled authored and poorbarcode committed May 30, 2023
1 parent 34bfe84 commit d09664a
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 d09664a

Please sign in to comment.