aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2023-04-21 08:42:20 +0200
committerGitHub <noreply@github.com>2023-04-21 08:42:20 +0200
commit6795d0352a225559efdfd68260a578cba22a5da4 (patch)
treeb1522031bb9821304f4ae7692c7a7a8e53244a05
parentaf978333909c38c81fae4a0f71b8f2ed181c3439 (diff)
parent2937e37f9bf0d163404cb7a5cebd30451747a2b4 (diff)
Merge pull request #26802 from vespa-engine/jonmv/do-not-retry-SSLExceptions
Do not retry SSLException for feed operations
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpRequestStrategy.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpRequestStrategy.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpRequestStrategy.java
index ce86ad59ffe..4e2256f40b4 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpRequestStrategy.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpRequestStrategy.java
@@ -9,6 +9,7 @@ import ai.vespa.feed.client.FeedException;
import ai.vespa.feed.client.HttpResponse ;
import ai.vespa.feed.client.OperationStats;
+import javax.net.ssl.SSLException;
import java.io.IOException;
import java.nio.channels.CancelledKeyException;
import java.util.Map;
@@ -138,9 +139,9 @@ class HttpRequestStrategy implements RequestStrategy {
*/
private boolean retry(HttpRequest request, Throwable thrown, int attempt) {
breaker.failure(thrown);
- if ( (thrown instanceof IOException) // General IO problems.
- || (thrown instanceof CancellationException) // TLS session disconnect.
- || (thrown instanceof CancelledKeyException)) { // Selection cancelled.
+ if ( (thrown instanceof IOException && ! (thrown instanceof SSLException)) // General IO problems, but not SSL, which is irrecoverable.
+ || (thrown instanceof CancellationException) // TLS session disconnect.
+ || (thrown instanceof CancelledKeyException)) { // Selection cancelled.
log.log(FINER, thrown, () -> "Failed attempt " + attempt + " at " + request);
return retry(request, attempt);
}