-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Clients/Java Low Level REST ClientMinimal dependencies Java Client for ElasticsearchMinimal dependencies Java Client for Elasticsearch>bugv5.6.7v6.0.3v6.1.1v6.2.0v7.0.0-beta1
Description
In 5.6 we introduced a change to the rest client that told the apache client to use system properties for some settings (3e4bc02).
HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClientBuilder.create().setDefaultRequestConfig(requestConfigBuilder.build())
//default settings for connection pooling may be too constraining
.setMaxConnPerRoute(DEFAULT_MAX_CONN_PER_ROUTE).setMaxConnTotal(DEFAULT_MAX_CONN_TOTAL).useSystemProperties();
This was introduced to force the client to use the system default SSLContext. Unfortunately this also leads the http client to use system properties for max connections, keep alive, and other configs. This means that our settings of DEFAULT_MAX_CONN_PER_ROUTE and DEFAULT_MAX_CONN_TOTAL are ignored. Additionally any settings that a user changes related to the client might be ignored (depending on the setting).
org.apache.http.impl.nio.client.HttpAsyncClientBuilder.class
if (systemProperties) {
String s = System.getProperty("http.keepAlive", "true");
if ("true".equalsIgnoreCase(s)) {
s = System.getProperty("http.maxConnections", "5");
final int max = Integer.parseInt(s);
poolingmgr.setDefaultMaxPerRoute(max);
poolingmgr.setMaxTotal(2 * max);
}
} else {
if (maxConnTotal > 0) {
poolingmgr.setMaxTotal(maxConnTotal);
}
if (maxConnPerRoute > 0) {
poolingmgr.setDefaultMaxPerRoute(maxConnPerRoute);
}
}
I think we need to configured the SSLContext specifically, opposed for forcing system properties for many settings.
Metadata
Metadata
Assignees
Labels
:Clients/Java Low Level REST ClientMinimal dependencies Java Client for ElasticsearchMinimal dependencies Java Client for Elasticsearch>bugv5.6.7v6.0.3v6.1.1v6.2.0v7.0.0-beta1