denis-chudov commented on code in PR #6389:
URL: https://github.com/apache/ignite-3/pull/6389#discussion_r2263140704


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/ZonePartitionReplicaListener.java:
##########
@@ -207,7 +222,23 @@ private static PendingTxPartitionEnlistment 
createAbandonedTxRecoveryEnlistment(
     public CompletableFuture<ReplicaResult> invoke(ReplicaRequest request, 
UUID senderId) {
         return replicaPrimacyEngine.validatePrimacy(request)
                 .thenCompose(replicaPrimacy -> processRequest(request, 
replicaPrimacy, senderId))
-                .thenApply(res -> {
+                .handle((res, ex) -> {
+                    if (ex == null) {
+                        timeoutedAttemptsCounter.set(0);
+
+                        return res;
+                    }
+
+                    if (request instanceof ReplicaSafeTimeSyncRequest) {
+                        if (hasCause(ex, TimeoutException.class, 
ReplicationTimeoutException.class)) {
+                            tryToLogTimeoutFailure(ex);
+                        } else {
+                            timeoutedAttemptsCounter.set(0);
+                        }
+                    }
+
+                    throw new CompletionException(ex);
+                }).thenApply(res -> {

Review Comment:
   I would recommend to do it within ReplicaManager. Advantages that I see:
   - it doesn't depend on ReplicaListener implementation (and now you have this 
code only in one of them)
   - it doesn't require the ReplicaListeners' contructors modifications and 
corresponding changes in tests
   - and all in all, makes the fix more local and compact.
   
   Probably, on some day we will need throttling logger in replica listeners, 
but now it's not necessary, so I wouldn't change them now



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