From 6be54fbb88961c0e684e74e8aeef7d9e88186904 Mon Sep 17 00:00:00 2001 From: Aymeric Date: Thu, 3 Nov 2022 16:33:54 +0000 Subject: [PATCH] Add retry on 500 (#124) --- .github/workflows/release.yml | 2 +- .../java/com/firebolt/jdbc/client/config/RetryInterceptor.java | 1 + .../com/firebolt/jdbc/client/config/RetryInterceptorTest.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c15ee859..7356737cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release new version on: release: - types: [published] + types: [created] jobs: build: diff --git a/src/main/java/com/firebolt/jdbc/client/config/RetryInterceptor.java b/src/main/java/com/firebolt/jdbc/client/config/RetryInterceptor.java index a030d61a4..e01f31b28 100644 --- a/src/main/java/com/firebolt/jdbc/client/config/RetryInterceptor.java +++ b/src/main/java/com/firebolt/jdbc/client/config/RetryInterceptor.java @@ -19,6 +19,7 @@ public class RetryInterceptor implements Interceptor { private static final Set RETRYABLE_RESPONSE_CODES = new HashSet<>(Arrays.asList(HTTP_CLIENT_TIMEOUT, + HTTP_INTERNAL_ERROR, HTTP_BAD_GATEWAY, HTTP_UNAVAILABLE, HTTP_GATEWAY_TIMEOUT)); diff --git a/src/test/java/com/firebolt/jdbc/client/config/RetryInterceptorTest.java b/src/test/java/com/firebolt/jdbc/client/config/RetryInterceptorTest.java index a257a8101..7eeb16926 100644 --- a/src/test/java/com/firebolt/jdbc/client/config/RetryInterceptorTest.java +++ b/src/test/java/com/firebolt/jdbc/client/config/RetryInterceptorTest.java @@ -17,7 +17,7 @@ class RetryInterceptorTest { @ParameterizedTest - @ValueSource(ints = {HTTP_CLIENT_TIMEOUT, HTTP_BAD_GATEWAY, HTTP_UNAVAILABLE, + @ValueSource(ints = {HTTP_CLIENT_TIMEOUT, HTTP_INTERNAL_ERROR, HTTP_BAD_GATEWAY, HTTP_UNAVAILABLE, HTTP_GATEWAY_TIMEOUT}) void shouldRetryOnRetryableResponseCode(int arg) throws IOException { int retries = 3;