Skip to content

Commit

Permalink
fix: enable OkHttp retries for connection failure (#359)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bednar authored Jun 3, 2022
1 parent 99208f5 commit 0e166e6
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 31 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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]

Expand Down
2 changes: 1 addition & 1 deletion client-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion client-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client</artifactId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-flux</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-osgi</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion client-scala/cross/2.12/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion client-scala/cross/2.13/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion client-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-test</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-utils</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<properties>
<checkstyle.skip>true</checkstyle.skip>
<influxdb-client.version>6.2.0-SNAPSHOT</influxdb-client.version>
<influxdb-client.version>6.1.1-SNAPSHOT</influxdb-client.version>
</properties>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion flux-dsl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<artifactId>flux-dsl</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion karaf/karaf-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-karaf</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<artifactId>influxdb-karaf-assembly</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion karaf/karaf-features/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-karaf</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<artifactId>influxdb-karaf-features</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions karaf/karaf-kar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-karaf</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<artifactId>influxdb-karaf-kar</artifactId>
Expand Down Expand Up @@ -75,7 +75,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>influxdb-karaf-features</artifactId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
<classifier>features</classifier>
<type>xml</type>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion karaf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<artifactId>influxdb-karaf</artifactId>
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<groupId>com.influxdb</groupId>
<artifactId>influxdb-client</artifactId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
Expand Down Expand Up @@ -475,38 +475,38 @@
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-test</artifactId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-core</artifactId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-utils</artifactId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-java</artifactId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-reactive</artifactId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-flux</artifactId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>influxdb-spring</artifactId>
<version>6.2.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Spring Integration for InfluxDB 2.x</name>
Expand Down

0 comments on commit 0e166e6

Please sign in to comment.