From 0e166e6754c6551ab4d30c7357dbad27392b20b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bedn=C3=A1=C5=99?= Date: Fri, 3 Jun 2022 09:56:08 +0200 Subject: [PATCH] fix: enable OkHttp retries for connection failure (#359) * chore: change version to 6.1.1-SNAPSHOT * fix: enable OkHttp retries for connection failure * fix(test): OkHttp has special logic for 408 * docs: update CHANGELOG.md --- CHANGELOG.md | 8 +++++++- client-core/pom.xml | 2 +- client-kotlin/pom.xml | 2 +- client-legacy/pom.xml | 2 +- client-osgi/pom.xml | 2 +- client-reactive/pom.xml | 2 +- .../client/reactive/QueryReactiveApiTest.java | 2 +- client-scala/cross/2.12/pom.xml | 2 +- client-scala/cross/2.13/pom.xml | 2 +- client-test/pom.xml | 2 +- client-utils/pom.xml | 2 +- client/pom.xml | 2 +- .../client/internal/AbstractInfluxDBClient.java | 9 +++++++-- examples/pom.xml | 4 ++-- flux-dsl/pom.xml | 2 +- karaf/karaf-assembly/pom.xml | 2 +- karaf/karaf-features/pom.xml | 2 +- karaf/karaf-kar/pom.xml | 4 ++-- karaf/pom.xml | 2 +- pom.xml | 14 +++++++------- spring/pom.xml | 4 ++-- 21 files changed, 42 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84f8558bacd..0753235d4d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ ## 6.2.0 [unreleased] -1. [#353](https://github.com/influxdata/influxdb-client-java/pull/353): Supports `contains` filter [FluxDSL] +## 6.1.1 [unreleased] + +### Features +1. [#354](https://github.com/influxdata/influxdb-client-java/pull/354): Supports `contains` filter [FluxDSL] + +### Bug Fixes +1. [#359](https://github.com/influxdata/influxdb-client-java/pull/359): Enable `OkHttp` retries for connection failure ## 6.1.0 [2022-05-20] diff --git a/client-core/pom.xml b/client-core/pom.xml index c091f8af5f5..85cb2ba5e51 100644 --- a/client-core/pom.xml +++ b/client-core/pom.xml @@ -28,7 +28,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT influxdb-client-core diff --git a/client-kotlin/pom.xml b/client-kotlin/pom.xml index f17857cde1b..f6ebaac8954 100644 --- a/client-kotlin/pom.xml +++ b/client-kotlin/pom.xml @@ -26,7 +26,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT 4.0.0 diff --git a/client-legacy/pom.xml b/client-legacy/pom.xml index 5fd759c571e..61c52a79c2b 100644 --- a/client-legacy/pom.xml +++ b/client-legacy/pom.xml @@ -28,7 +28,7 @@ com.influxdb influxdb-client - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT influxdb-client-flux diff --git a/client-osgi/pom.xml b/client-osgi/pom.xml index 3deaea4f479..73cd9afe2ab 100644 --- a/client-osgi/pom.xml +++ b/client-osgi/pom.xml @@ -28,7 +28,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT influxdb-client-osgi diff --git a/client-reactive/pom.xml b/client-reactive/pom.xml index 1827a768541..18ba014b365 100644 --- a/client-reactive/pom.xml +++ b/client-reactive/pom.xml @@ -26,7 +26,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT 4.0.0 diff --git a/client-reactive/src/test/java/com/influxdb/client/reactive/QueryReactiveApiTest.java b/client-reactive/src/test/java/com/influxdb/client/reactive/QueryReactiveApiTest.java index 8a1464e7775..f92d2ca8c22 100644 --- a/client-reactive/src/test/java/com/influxdb/client/reactive/QueryReactiveApiTest.java +++ b/client-reactive/src/test/java/com/influxdb/client/reactive/QueryReactiveApiTest.java @@ -62,7 +62,7 @@ void tearDown() { @Test public void doNotPropagateErrorOnCanceledConsumer() throws InterruptedException { - mockServer.enqueue(createErrorResponse("Request Timeout", true, 408) + mockServer.enqueue(createErrorResponse("Conflict", true, 409) .setBodyDelay(3, TimeUnit.SECONDS)); QueryReactiveApi queryApi = influxDBClient.getQueryReactiveApi(); diff --git a/client-scala/cross/2.12/pom.xml b/client-scala/cross/2.12/pom.xml index a546177d0ff..ba942b79317 100644 --- a/client-scala/cross/2.12/pom.xml +++ b/client-scala/cross/2.12/pom.xml @@ -26,7 +26,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/client-scala/cross/2.13/pom.xml b/client-scala/cross/2.13/pom.xml index 002b49ded65..6fb3cdbfd6c 100644 --- a/client-scala/cross/2.13/pom.xml +++ b/client-scala/cross/2.13/pom.xml @@ -26,7 +26,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/client-test/pom.xml b/client-test/pom.xml index ef26a493f23..c42251ff4d5 100644 --- a/client-test/pom.xml +++ b/client-test/pom.xml @@ -28,7 +28,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT influxdb-client-test diff --git a/client-utils/pom.xml b/client-utils/pom.xml index 55039d2e4f1..65fb1b36366 100644 --- a/client-utils/pom.xml +++ b/client-utils/pom.xml @@ -28,7 +28,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT influxdb-client-utils diff --git a/client/pom.xml b/client/pom.xml index 5e8d178fd5c..606e9d5a8e6 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -26,7 +26,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT 4.0.0 diff --git a/client/src/main/java/com/influxdb/client/internal/AbstractInfluxDBClient.java b/client/src/main/java/com/influxdb/client/internal/AbstractInfluxDBClient.java index dd2580cf439..88116c2663b 100644 --- a/client/src/main/java/com/influxdb/client/internal/AbstractInfluxDBClient.java +++ b/client/src/main/java/com/influxdb/client/internal/AbstractInfluxDBClient.java @@ -94,8 +94,13 @@ public AbstractInfluxDBClient(@Nonnull final InfluxDBClientOptions options, this.gzipInterceptor = new GzipInterceptor(); this.okHttpClient = options.getOkHttpClient() - // Connection errors are handled by RetryAttempt in AbstractWriteClient. - .retryOnConnectionFailure(false) + // + // We don't need to disable the `retryOnConnectionFailure`. The retry logic + // in the OkHttp is not in a collision with our "exponential backoff strategy" + // for writes. OkHttp logic uses the possibility of routing to another "routes" + // - e.g. network loopback or multiple proxies. + // + //.retryOnConnectionFailure(false) .addInterceptor(new UserAgentInterceptor(clientType)) .addInterceptor(this.loggingInterceptor) .addInterceptor(this.authenticateInterceptor) diff --git a/examples/pom.xml b/examples/pom.xml index 53ddb82b9d8..2aba90de273 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -27,12 +27,12 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT true - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT 4.0.0 diff --git a/flux-dsl/pom.xml b/flux-dsl/pom.xml index afe7d9b203a..c775c478729 100644 --- a/flux-dsl/pom.xml +++ b/flux-dsl/pom.xml @@ -28,7 +28,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT flux-dsl diff --git a/karaf/karaf-assembly/pom.xml b/karaf/karaf-assembly/pom.xml index e3013aa1fd8..1246b6d8790 100644 --- a/karaf/karaf-assembly/pom.xml +++ b/karaf/karaf-assembly/pom.xml @@ -28,7 +28,7 @@ influxdb-karaf com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT influxdb-karaf-assembly diff --git a/karaf/karaf-features/pom.xml b/karaf/karaf-features/pom.xml index f9d8d3b0e7e..960d6b5773c 100644 --- a/karaf/karaf-features/pom.xml +++ b/karaf/karaf-features/pom.xml @@ -28,7 +28,7 @@ influxdb-karaf com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT influxdb-karaf-features diff --git a/karaf/karaf-kar/pom.xml b/karaf/karaf-kar/pom.xml index ec57a70ffc9..39e6f1d33f7 100644 --- a/karaf/karaf-kar/pom.xml +++ b/karaf/karaf-kar/pom.xml @@ -28,7 +28,7 @@ influxdb-karaf com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT influxdb-karaf-kar @@ -75,7 +75,7 @@ ${project.groupId} influxdb-karaf-features - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT features xml diff --git a/karaf/pom.xml b/karaf/pom.xml index 2009e45b959..96cab118126 100644 --- a/karaf/pom.xml +++ b/karaf/pom.xml @@ -28,7 +28,7 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT influxdb-karaf diff --git a/pom.xml b/pom.xml index 1fe89845ec5..4ad946c776f 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ com.influxdb influxdb-client - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT pom @@ -475,38 +475,38 @@ com.influxdb influxdb-client-test - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT test com.influxdb influxdb-client-core - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT com.influxdb influxdb-client-utils - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT com.influxdb influxdb-client-java - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT com.influxdb influxdb-client-reactive - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT com.influxdb influxdb-client-flux - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT diff --git a/spring/pom.xml b/spring/pom.xml index c904d267165..7c2f71345b3 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -26,12 +26,12 @@ influxdb-client com.influxdb - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT 4.0.0 influxdb-spring - 6.2.0-SNAPSHOT + 6.1.1-SNAPSHOT jar Spring Integration for InfluxDB 2.x