Skip to content

[ML] No error when datafeed stops during updating to started #46495

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.ResourceNotFoundException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterChangedEvent;
Expand Down Expand Up @@ -95,7 +96,12 @@ public void onResponse(PersistentTask<?> persistentTask) {

@Override
public void onFailure(Exception e) {
finishHandler.accept(e);
if (e instanceof ResourceNotFoundException) {
// The task was stopped in the meantime, no need to do anything
logger.info("[{}] Aborting as datafeed has been stopped", datafeedId);
} else {
finishHandler.accept(e);
}
}
});
}, finishHandler::accept
Expand Down