Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DE-169] fixed retry behavior of HTTP connections in case of timeout exceptions #429

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

## [Unreleased]

- fixed retry behavior of HTTP connections in case of timeout exceptions

## [6.16.0] - 2022-01-27

- deprecated hash and skiplist indexes (#424)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.arangodb</groupId>
<artifactId>arangodb-java-driver</artifactId>
<version>6.16.0</version>
<version>6.16.1-SNAPSHOT</version>
<inceptionYear>2016</inceptionYear>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

import java.io.Closeable;
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.concurrent.TimeoutException;

/**
* @author Mark Vollmary
Expand Down Expand Up @@ -85,6 +87,13 @@ private Response execute(final Request request, final HostHandle hostHandle, fin
hostHandler.success();
hostHandler.confirm();
return response;
} catch (final SocketTimeoutException e) {
// SocketTimeoutException exceptions are wrapped and rethrown.
// Differently from other IOException exceptions they must not be retried,
// since the requests could not be idempotent.
TimeoutException te = new TimeoutException(e.getMessage());
te.initCause(e);
throw new ArangoDBException(te);
} catch (final IOException e) {
hostHandler.fail(e);
if (hostHandle != null && hostHandle.getHost() != null) {
Expand Down