Skip to content

Commit 6acab31

Browse files
committed
OkHttpClient restore retryOnConnectionFailure#true by default due to weird OkHttp behavior during connection (turn off for predictable connection timeout)
1 parent 7a60d6a commit 6acab31

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

http/http-client-ok/src/main/java/ru/tinkoff/kora/http/client/ok/OkHttpClientConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ default boolean followRedirects() {
99
return true;
1010
}
1111

12+
default boolean retryOnConnectionFailure() {
13+
return true;
14+
}
15+
1216
default HttpVersion httpVersion() {
1317
return HttpVersion.HTTP_1_1;
1418
}

http/http-client-ok/src/main/java/ru/tinkoff/kora/http/client/ok/OkHttpClientWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void init() {
3434

3535
var builder = new OkHttpClient.Builder()
3636
.fastFallback(false)
37-
.retryOnConnectionFailure(false)
37+
.retryOnConnectionFailure(this.config.retryOnConnectionFailure())
3838
.connectTimeout(this.baseConfig.connectTimeout())
3939
.readTimeout(this.baseConfig.readTimeout())
4040
.followRedirects(this.config.followRedirects());

0 commit comments

Comments
 (0)