Skip to content

Commit eb32f2a

Browse files
committed
Don't close/recreate adaptive allocations metrics (#114721)
1 parent a0c5af3 commit eb32f2a

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,6 @@ Collection<DoubleWithAttributes> observeDouble(Function<AdaptiveAllocationsScale
171171
}
172172
return observations;
173173
}
174-
175-
void close() {
176-
for (AutoCloseable metric : metrics) {
177-
try {
178-
metric.close();
179-
} catch (Exception e) {
180-
// do nothing
181-
}
182-
}
183-
metrics.clear();
184-
}
185174
}
186175

187176
/**
@@ -261,7 +250,7 @@ public synchronized void start() {
261250
public synchronized void stop() {
262251
clusterService.removeListener(this);
263252
stopScheduling();
264-
metrics.close();
253+
scalers.clear();
265254
}
266255

267256
@Override

0 commit comments

Comments
 (0)