Skip to content

Commit

Permalink
[ML] Remove the cluster state listener when the adaptive allocations …
Browse files Browse the repository at this point in the history
…service stops (elastic#113524)
  • Loading branch information
davidkyle authored Sep 25, 2024
1 parent 328f463 commit a34e9fc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,17 @@ public synchronized void start() {
}

public synchronized void stop() {
clusterService.removeListener(this);
stopScheduling();
metrics.close();
}

@Override
public void clusterChanged(ClusterChangedEvent event) {
if (event.metadataChanged() == false) {
return;
}

updateAutoscalers(event.state());
if (scalers.isEmpty() == false) {
startScheduling();
Expand Down

0 comments on commit a34e9fc

Please sign in to comment.