aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahooinc.com>2023-07-10 12:50:36 +0200
committerBjørn Christian Seime <bjorncs@yahooinc.com>2023-07-10 13:49:14 +0200
commit5773abc64ed26bf39cd387c1d446f904529886bc (patch)
treeecc86845c169b41d9ec36edd8bbbaaa3d7539a03 /vespa-feed-client
parent10747ac5af65931efbee252041f7a31daa874605 (diff)
Set timeouts on connector
Diffstat (limited to 'vespa-feed-client')
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/JettyCluster.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/JettyCluster.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/JettyCluster.java
index 79fe8dd630f..58838e5a597 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/JettyCluster.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/JettyCluster.java
@@ -124,6 +124,8 @@ class JettyCluster implements Cluster {
int threads = Math.max(Math.min(Runtime.getRuntime().availableProcessors(), 32), 8);
connector.setExecutor(new QueuedThreadPool(threads));
connector.setSslContextFactory(clientSslCtxFactory);
+ connector.setIdleTimeout(IDLE_TIMEOUT);
+ connector.setConnectTimeout(Duration.ofSeconds(10));
HTTP2Client h2Client = new HTTP2Client(connector);
h2Client.setMaxConcurrentPushedStreams(b.maxStreamsPerConnection);
// Set the HTTP/2 flow control windows very large to cause TCP congestion instead of HTTP/2 flow control congestion.
@@ -141,12 +143,10 @@ class JettyCluster implements Cluster {
httpClient.setFollowRedirects(false);
httpClient.setUserAgentField(
new HttpField(HttpHeader.USER_AGENT, String.format("vespa-feed-client/%s (Jetty)", Vespa.VERSION)));
- httpClient.setConnectTimeout(Duration.ofSeconds(10).toMillis());
// Stop client from trying different IP address when TLS handshake fails
httpClient.setSocketAddressResolver(new Ipv4PreferringResolver(httpClient, Duration.ofSeconds(10)));
httpClient.setCookieStore(new HttpCookieStore.Empty());
- httpClient.setIdleTimeout(IDLE_TIMEOUT.toMillis());
try {
httpClient.start();
} catch (Exception e) {