rpuch commented on code in PR #4821:
URL: https://github.com/apache/ignite-3/pull/4821#discussion_r1892167623


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -1956,15 +1935,13 @@ private 
CompletableFuture<WriteIntentSwitchReplicatedInfo> applyWriteIntentSwitc
                 indexIdsAtRwTxBeginTs(transactionId)
         );
 
-        CompletableFuture<Object> resultFuture = new CompletableFuture<>();
-
-        applyCmdWithRetryOnSafeTimeReorderException(wiSwitchCmd, resultFuture);
-
-        return resultFuture
+        return applyCmdWithExceptionHandling(wiSwitchCmd)
                 .exceptionally(e -> {
                     LOG.warn("Failed to complete transaction cleanup command 
[txId=" + transactionId + ']', e);
 
-                    return nullCompletedFuture();
+                    ExceptionUtils.sneakyThrow(e);

Review Comment:
   My question was probably confusing, I'll break it down.
   
   1. The code was specifically using `exceptionally()` to make sure an 
exception doesn't propagate. I'm not sure this is the correct thing to do here, 
but we could ask the author. @denis-chudov could you please explain why the 
exception was just being logged and its propagation stopped?
   2. If we actually don't need to stop exception propagation, then this 
`exceptionally()` step is not needed. If we just want to log it (and let it 
propagate), then it seems more natural to use `whenComplete((res, ex) -> { if 
(ex != null) log(ex) }) instead of `exceptionally()`



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to