diff --git a/table/src/main/java/tech/ydb/table/SessionRetryContext.java b/table/src/main/java/tech/ydb/table/SessionRetryContext.java index 6833ddb0e..027b3518c 100644 --- a/table/src/main/java/tech/ydb/table/SessionRetryContext.java +++ b/table/src/main/java/tech/ydb/table/SessionRetryContext.java @@ -266,7 +266,7 @@ private void handleException(@Nonnull Throwable ex) { handler.onRetry(SessionRetryContext.this, ex, retry, next, ms()); scheduleNext(next); } else { - handler.onError(SessionRetryContext.this, ex, maxRetries, ms()); + handler.onLimit(SessionRetryContext.this, ex, maxRetries, ms()); promise.completeExceptionally(ex); } } diff --git a/table/src/main/java/tech/ydb/table/SessionRetryHandler.java b/table/src/main/java/tech/ydb/table/SessionRetryHandler.java index e5242dbed..101ba55fc 100644 --- a/table/src/main/java/tech/ydb/table/SessionRetryHandler.java +++ b/table/src/main/java/tech/ydb/table/SessionRetryHandler.java @@ -87,6 +87,20 @@ default void onLimit(SessionRetryContext context, StatusCode code, context.hashCode(), code, retryLimit, millis); } + /** + * Called on retryable exception when the limit is reached. + * + * @param context Session retry object + * @param issue Retryable exception + * @param retryLimit Maximum number of retries + * @param millis Elapsed time + */ + default void onLimit(SessionRetryContext context, Throwable issue, + int retryLimit, long millis) { + LOGGER.debug("RetryCtx[{}] RETRYABLE ERROR[{}], finished by retries limit ({}), {} ms total", + context.hashCode(), errorMsg(issue), retryLimit, millis); + } + /** * Called on non-retryable error. *