Skip to content

Commit 5508d89

Browse files
authored
Use HARD_CODED_MACHINE_LEARNING_MASTER_NODE_TIMEOUT in more places (#120701)
This hard-coded timeout is trappy, but its removal is not as imminent as `TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUT` (see #107984). This commit removes a handful more usages of the trappy timeout bringing us closer to its removal.
1 parent 29afce6 commit 5508d89

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlInitializationService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public void clusterChanged(ClusterChangedEvent event) {
155155
AnnotationIndex.createAnnotationsIndexIfNecessary(
156156
client,
157157
event.state(),
158-
MasterNodeRequest.TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUT,
158+
MachineLearning.HARD_CODED_MACHINE_LEARNING_MASTER_NODE_TIMEOUT,
159159
ActionListener.wrap(r -> isIndexCreationInProgress.set(false), e -> {
160160
if (e.getMessage().equals(previousException)) {
161161
logger.debug("Error creating ML annotations index or aliases", e);

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/TrainedModelStatsService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.elasticsearch.action.support.IndicesOptions;
1515
import org.elasticsearch.action.support.PlainActionFuture;
1616
import org.elasticsearch.action.support.WriteRequest;
17-
import org.elasticsearch.action.support.master.MasterNodeRequest;
1817
import org.elasticsearch.action.update.UpdateRequest;
1918
import org.elasticsearch.client.internal.OriginSettingClient;
2019
import org.elasticsearch.cluster.ClusterChangedEvent;
@@ -256,14 +255,14 @@ private void createStatsIndexIfNecessary() {
256255
client,
257256
clusterState,
258257
indexNameExpressionResolver,
259-
MasterNodeRequest.TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUT,
258+
MachineLearning.HARD_CODED_MACHINE_LEARNING_MASTER_NODE_TIMEOUT,
260259
ActionListener.wrap(
261260
r -> ElasticsearchMappings.addDocMappingIfMissing(
262261
MlStatsIndex.writeAlias(),
263262
MlStatsIndex::wrappedMapping,
264263
client,
265264
clusterState,
266-
MasterNodeRequest.TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUT,
265+
MachineLearning.HARD_CODED_MACHINE_LEARNING_MASTER_NODE_TIMEOUT,
267266
listener,
268267
MlStatsIndex.STATS_INDEX_MAPPINGS_VERSION
269268
),

0 commit comments

Comments
 (0)