aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/JettyCluster.java6
1 files changed, 5 insertions, 1 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 3a5c98ca27c..e4e6fbe752e 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
@@ -140,7 +140,9 @@ class JettyCluster implements Cluster {
connector.setExecutor(new QueuedThreadPool(threads));
connector.setSslContextFactory(clientSslCtxFactory);
connector.setIdleTimeout(IDLE_TIMEOUT);
- connector.setConnectTimeout(Duration.ofSeconds(30));
+ boolean secureProxy = b.proxy != null && b.proxy.getScheme().equals("https");
+ // Increase connect timeout for secure HTTP/2 proxy
+ connector.setConnectTimeout(Duration.ofSeconds(secureProxy ? 120 : 30));
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.
@@ -156,6 +158,8 @@ class JettyCluster implements Cluster {
MultiplexConnectionPool pool = new MultiplexConnectionPool(
dest, Pool.StrategyType.RANDOM, connectionsPerEndpoint, false, dest, Integer.MAX_VALUE);
pool.preCreateConnections(connectionsPerEndpoint);
+ if (secureProxy) pool.setMaxDuration(Duration.ofMinutes(1).toMillis());
+ else pool.setMaximizeConnections(true);
return pool;
});
HttpClient httpClient = new HttpClient(transport);