-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ML] Inference API add configurable connection pool TTL #127585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,20 +70,33 @@ public class ElasticInferenceServiceSettings { | |
| Setting.Property.NodeScope | ||
| ); | ||
|
|
||
| /** | ||
| * Total time to live (TTL) defines maximum life span of persistent connections regardless of their | ||
| * expiration setting. No persistent connection will be re-used past its TTL value. | ||
| */ | ||
| public static final Setting<TimeValue> CONNECTION_TTL_SETTING = Setting.timeSetting( | ||
| "xpack.inference.elastic.http.connection_ttl", | ||
| // -1 indicates that the TTL never expires | ||
| TimeValue.MINUS_ONE, | ||
|
||
| Setting.Property.NodeScope | ||
| ); | ||
|
|
||
| @Deprecated | ||
| private final String eisGatewayUrl; | ||
|
|
||
| private final String elasticInferenceServiceUrl; | ||
| private final boolean periodicAuthorizationEnabled; | ||
| private volatile TimeValue authRequestInterval; | ||
| private volatile TimeValue maxAuthorizationRequestJitter; | ||
| private final TimeValue connectionTtl; | ||
|
|
||
| public ElasticInferenceServiceSettings(Settings settings) { | ||
| eisGatewayUrl = EIS_GATEWAY_URL.get(settings); | ||
| elasticInferenceServiceUrl = ELASTIC_INFERENCE_SERVICE_URL.get(settings); | ||
| periodicAuthorizationEnabled = PERIODIC_AUTHORIZATION_ENABLED.get(settings); | ||
| authRequestInterval = AUTHORIZATION_REQUEST_INTERVAL.get(settings); | ||
| maxAuthorizationRequestJitter = MAX_AUTHORIZATION_REQUEST_JITTER.get(settings); | ||
| connectionTtl = CONNECTION_TTL_SETTING.get(settings); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -115,6 +128,10 @@ public TimeValue getMaxAuthorizationRequestJitter() { | |
| return maxAuthorizationRequestJitter; | ||
| } | ||
|
|
||
| public TimeValue getConnectionTtl() { | ||
| return connectionTtl; | ||
| } | ||
|
|
||
| public static List<Setting<?>> getSettingsDefinitions() { | ||
| ArrayList<Setting<?>> settings = new ArrayList<>(); | ||
| settings.add(EIS_GATEWAY_URL); | ||
|
|
@@ -124,6 +141,7 @@ public static List<Setting<?>> getSettingsDefinitions() { | |
| settings.add(PERIODIC_AUTHORIZATION_ENABLED); | ||
| settings.add(AUTHORIZATION_REQUEST_INTERVAL); | ||
| settings.add(MAX_AUTHORIZATION_REQUEST_JITTER); | ||
| settings.add(CONNECTION_TTL_SETTING); | ||
| return settings; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the constructor for the pooling connection manager