From 9e8924b15f8c3438b9e5fe8405e8f1e8c4a97ad3 Mon Sep 17 00:00:00 2001 From: Xin Li <137219293+xinlili-statsig@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:26:34 -0800 Subject: [PATCH] disable library retry (#413) Contex: Within we already manually retry on failure, disable library retry on connection There is a bug in okhttp client library that creates an infinite loop on exceptions https://github.com/square/okhttp/issues/7530 --- src/main/kotlin/com/statsig/sdk/network/HTTPWorker.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/com/statsig/sdk/network/HTTPWorker.kt b/src/main/kotlin/com/statsig/sdk/network/HTTPWorker.kt index 39f49c1..a1e2a8b 100644 --- a/src/main/kotlin/com/statsig/sdk/network/HTTPWorker.kt +++ b/src/main/kotlin/com/statsig/sdk/network/HTTPWorker.kt @@ -67,6 +67,7 @@ internal class HTTPWorker( init { val clientBuilder = OkHttpClient.Builder() + clientBuilder.retryOnConnectionFailure(false) clientBuilder.addInterceptor( Interceptor {