summaryrefslogtreecommitdiffstats
path: root/vespa-feed-client
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahooinc.com>2023-09-11 10:50:38 +0200
committerBjørn Christian Seime <bjorncs@yahooinc.com>2023-09-12 08:57:46 +0200
commitcde41bf8bc605bb03965c732e5ef41af6f0eeab0 (patch)
tree15e67898246ab7e2254002a84beac2508e6d7e03 /vespa-feed-client
parent02da9c29fb143c1525bf58abc6910eed5807ebe0 (diff)
Retry when new stream fail due to concurrent GOAWAY
Diffstat (limited to 'vespa-feed-client')
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpRequestStrategy.java10
1 files changed, 5 insertions, 5 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 ebbff9ed84b..fba9ef06f2b 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
@@ -6,14 +6,12 @@ import ai.vespa.feed.client.FeedClient;
import ai.vespa.feed.client.FeedClient.CircuitBreaker;
import ai.vespa.feed.client.FeedClient.RetryStrategy;
import ai.vespa.feed.client.FeedException;
-import ai.vespa.feed.client.HttpResponse ;
+import ai.vespa.feed.client.HttpResponse;
import ai.vespa.feed.client.OperationStats;
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;
@@ -139,8 +137,10 @@ 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.
+
+ // Thrown by HTTP2Session.StreamsState.reserveSlot, likely on GOAWAY from server
+ || (thrown instanceof IllegalStateException && thrown.getMessage().equals("session closed"))
+ ) {
log.log(FINER, thrown, () -> "Failed attempt " + attempt + " at " + request);
return retry(request, attempt);
}