Skip to content

Commit 755f08f

Browse files
authored
Retry attempts to acquire a new channel on generic failures
Do a generic retry on ExecutionException in Client
1 parent 5947994 commit 755f08f

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

driver/pom.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<java.apidoc>http://docs.oracle.com/javase/8/docs/api</java.apidoc>
4848
<maven.deploy.skip>false</maven.deploy.skip>
4949
<netty.version>4.1.94.Final</netty.version>
50-
<jackson.version>2.13.2</jackson.version>
50+
<jackson.version>2.15.2</jackson.version>
5151
<bouncy.version>1.70</bouncy.version>
5252
<!-- by default, skip tests; tests require a profile -->
5353
<maven.test.skip>true</maven.test.skip>
@@ -370,10 +370,7 @@
370370
<link>${java.apidoc}</link>
371371
<additionalOptions>
372372
<additionalOption>-author</additionalOption>
373-
<additionalOption>--frames</additionalOption>
374373
</additionalOptions>
375-
<!-- below option makes the search bar work correctly -->
376-
<additionalJOption>--no-module-directories</additionalJOption>
377374
<!-- put output in target/apidocs -->
378375
<reportOutputDirectory>
379376
${project.build.directory}/apidocs

driver/src/main/java/oracle/nosql/driver/http/Client.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -880,13 +880,20 @@ public Result execute(Request kvRequest) {
880880
throw new NoSQLException("Request interrupted: " +
881881
ie.getMessage());
882882
} catch (ExecutionException ee) {
883-
kvRequest.setRateLimitDelayedMs(rateDelayedMs);
884-
statsControl.observeError(kvRequest);
885-
logInfo(logger, "Unable to execute request: " +
886-
ee.getCause().getMessage());
887-
/* is there a better exception? */
888-
throw new NoSQLException(
889-
"Unable to execute request: " + ee.getCause().getMessage());
883+
/*
884+
* This can happen if a channel is bad in HttpClient.getChannel.
885+
* This happens if the channel is shut down by the server side
886+
* or the server (proxy) is restarted, etc. Treat it like
887+
* IOException above, but retry without waiting
888+
*/
889+
String name = ee.getCause().getClass().getName();
890+
logFine(logger, "Client ExecutionException, name: " +
891+
name + ", message: " + ee.getMessage() + ", retrying");
892+
893+
kvRequest.addRetryException(ee.getCause().getClass());
894+
kvRequest.incrementRetries();
895+
exception = ee.getCause();
896+
continue;
890897
} catch (TimeoutException te) {
891898
exception = te;
892899
logInfo(logger, "Timeout exception: " + te);

0 commit comments

Comments
 (0)