diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-06-18 13:55:52 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-06-21 09:27:15 +0200 |
commit | 7e20b3b9e65d80cf2240e2afc6c8946db298f7b8 (patch) | |
tree | 50391c91ec20387298fb3cf58c1d4d6ee79363b8 /vespa-feed-client | |
parent | 7c371a9d9bdd24c3bd321d5c290baa8ca12653a5 (diff) |
Retry some more exceptions thrown by apache
Diffstat (limited to 'vespa-feed-client')
-rw-r--r-- | vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java index 98ff3a5d921..1bd69d1e1f6 100644 --- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java +++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java @@ -5,8 +5,10 @@ import ai.vespa.feed.client.FeedClient.CircuitBreaker; import ai.vespa.feed.client.FeedClient.RetryStrategy; import java.io.IOException; +import java.nio.channels.CancelledKeyException; import java.util.Map; import java.util.Queue; +import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; @@ -137,10 +139,12 @@ class HttpRequestStrategy implements RequestStrategy { breaker.failure(); log.log(FINE, thrown, () -> "Failed attempt " + attempt + " at " + request); - if ( ! (thrown instanceof IOException)) - return false; + if ( (thrown instanceof IOException) // General IO problems. + || (thrown instanceof CancellationException) // TLS session disconnect. + || (thrown instanceof CancelledKeyException)) // Selection cancelled. + return retry(request, attempt); - return retry(request, attempt); + return false; } private void incrementTargetInflight() { |