ibessonov commented on code in PR #5679: URL: https://github.com/apache/ignite-3/pull/5679#discussion_r2060346926
########## modules/raft/src/main/java/org/apache/ignite/internal/raft/RetryContext.java: ########## @@ -60,6 +69,11 @@ class RetryContext { */ private final Set<Peer> unavailablePeers = new HashSet<>(); + /** + * List of last {@value MAX_RETRY_REASONS} retry reasons. {@link LinkedList} in order to allow fast head removal upon overflow. + */ + private final List<RetryReason> retryReasons = new LinkedList<>(); Review Comment: Probably ########## modules/raft/src/main/java/org/apache/ignite/internal/raft/RetryContext.java: ########## @@ -146,9 +164,37 @@ RetryContext nextAttempt(Peer newTargetPeer) { * * @return {@code this}. */ - RetryContext nextAttemptForUnavailablePeer(Peer newTargetPeer) { + RetryContext nextAttemptForUnavailablePeer(Peer newTargetPeer, String shortReasonMessage) { unavailablePeers.add(targetPeer); - return nextAttempt(newTargetPeer); + return nextAttempt(newTargetPeer, shortReasonMessage); + } + + TimeoutException createTimeoutException() { + return new TimeoutException(format( + "Send with retry timed out [retryCount = {}, groupId = {}, traceId = {}, request = {}, originCommand = {}," + + " retryReasons={}].", + retryCount, + groupId, + errorTraceId, + request.toStringForLightLogging(), + originDescription.get(), + retryReasons.toString() + )); + } + + private static class RetryReason { + final long timestamp; + final String reason; + + RetryReason(String reason) { + this.timestamp = System.currentTimeMillis(); + this.reason = reason; + } + + @Override + public String toString() { + return "[time=" + timestamp + ", msg=" + reason + "]"; Review Comment: Sure -- 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