Skip to content

Commit 41bccff

Browse files
committed
Only retry for idempotent operation
1 parent af87f8b commit 41bccff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/ru/yandex/clickhouse/util/ClickHouseHttpClientBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ private HttpRequestRetryHandler getRequestRetryHandler() {
6969
return new DefaultHttpRequestRetryHandler(maxRetries, false) {
7070
@Override
7171
public boolean retryRequest(IOException exception, int executionCount, HttpContext context) {
72-
if (executionCount > maxRetries) {
72+
if (executionCount > maxRetries || context == null
73+
|| !Boolean.TRUE.equals(context.getAttribute("is_idempotent"))) {
7374
return false;
7475
}
7576

76-
// TODO should never retry for DDL/mutation
7777
return (exception instanceof NoHttpResponseException) || super.retryRequest(exception, executionCount, context);
7878
}
7979
};

0 commit comments

Comments
 (0)