Skip to content

Commit 31d17bc

Browse files
inference timeout for internal services
1 parent 4b0aded commit 31d17bc

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/BaseElasticsearchInternalService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ private void preferredVariantFromPlatformArchitecture(ActionListener<PreferredMo
263263
);
264264
}
265265

266+
protected TimeValue getConfiguredInferenceTimeout() {
267+
return clusterService.getClusterSettings().get(InferencePlugin.SEMANTIC_TEXT_INFERENCE_TIMEOUT);
268+
}
269+
266270
boolean isClusterInElasticCloud() {
267271
// Use the ml lazy node count as a heuristic to determine if in Elastic cloud.
268272
// A value > 0 means scaling should be available for ml nodes

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,9 @@ public void infer(
613613
TimeValue timeout,
614614
ActionListener<InferenceServiceResults> listener
615615
) {
616+
if (timeout == null) {
617+
timeout = getConfiguredInferenceTimeout();
618+
}
616619
if (model instanceof ElasticsearchInternalModel esModel) {
617620
var taskType = model.getConfigurations().getTaskType();
618621
if (TaskType.TEXT_EMBEDDING.equals(taskType)) {

0 commit comments

Comments
 (0)