Skip to content

Commit

Permalink
QueryingServerHelper retry changes (#389)
Browse files Browse the repository at this point in the history
* CQL issue with connection pool exhaustion

* RAD-630 update to QueryingServerHelper to handle retries better
  • Loading branch information
marianbuenosayres authored Oct 13, 2023
1 parent 00c7212 commit 9cf30a1
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion fhir-helpers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.elimu.a2d2</groupId>
<artifactId>fhir-helpers</artifactId>
<version>0.0.16</version>
<version>0.0.17</version>
<packaging>jar</packaging>
<name>fhir-helpers</name>
<url>http://maven.apache.org</url>
Expand Down
2 changes: 1 addition & 1 deletion fhir-query-helper-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</parent>

<artifactId>fhir-query-helper-base</artifactId>
<version>0.0.16</version>
<version>0.0.17</version>
<description>CDS Helper base</description>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ public T retryRestCall(FhirClientWrapper client) {
log.info("FHIR REST call failed attempt number " + count + " with status " + client.getTracker().getResponseStatusCode() + ". Retrying after waiting " + (delay * count) + "ms");
count++;
} catch (Throwable t) {
if (client.getTracker().getResponseStatusCode() >= 0 && client.getTracker().getResponseStatusCode() < 500) {
throw new RuntimeException("Invocation of call failed with status code " + client.getTracker().getResponseStatusCode() + ". No further retries will be performed");
}
count++; // and retry
log.warn("FHIR REST call failed attempt number " + count + " with status " + client.getTracker().getResponseStatusCode() + " and error. Retrying after waiting " + (delay * count) + "ms", t);
}
}
throw new RuntimeException("After " + count + " retries, invocation of clal still failed");
throw new RuntimeException("After " + count + " retries, invocation of call still failed");
}

public int getDelay(int count, int delay) {
Expand Down
2 changes: 1 addition & 1 deletion fhir-query-helper-dstu2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</parent>

<artifactId>fhir-query-helper-dstu2</artifactId>
<version>0.0.16</version>
<version>0.0.17</version>
<packaging>jar</packaging>
<description>CDS Helper</description>

Expand Down
2 changes: 1 addition & 1 deletion fhir-query-helper-dstu3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</parent>

<artifactId>fhir-query-helper-dstu3</artifactId>
<version>0.0.16</version>
<version>0.0.17</version>
<packaging>jar</packaging>
<description>CDS Helper DSTU3</description>

Expand Down
2 changes: 1 addition & 1 deletion fhir-query-helper-r4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</parent>

<artifactId>fhir-query-helper-r4</artifactId>
<version>0.0.16</version>
<version>0.0.17</version>
<packaging>jar</packaging>
<description>CDS Helper R4</description>

Expand Down
2 changes: 1 addition & 1 deletion oauth-helpers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</parent>

<artifactId>oauth-helpers</artifactId>
<version>0.0.16</version>
<version>0.0.17</version>
<description>OAuth Helper</description>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<protobuf-java.version>3.21.8</protobuf-java.version>
<mockito.version>2.23.0</mockito.version>
<jedis.version>4.0.1</jedis.version>
<cds.helper.version>0.0.16</cds.helper.version>
<cds.helper.version>0.0.17</cds.helper.version>
<freemarker.version>2.3.30</freemarker.version>
<jacoco.version>0.8.7</jacoco.version>
<jaxb.api.version>2.3.1</jaxb.api.version>
Expand Down

0 comments on commit 9cf30a1

Please sign in to comment.