Skip to content

[ML] Add "close_job" parameter to the stop datafeed API#138634

Merged
edsavage merged 11 commits intoelastic:mainfrom
edsavage:stop_datafeed_close_job_param
Dec 3, 2025
Merged

[ML] Add "close_job" parameter to the stop datafeed API#138634
edsavage merged 11 commits intoelastic:mainfrom
edsavage:stop_datafeed_close_job_param

Conversation

@edsavage
Copy link
Contributor

When the stop datafeed API is called with close_job=true the job associated with the datafeed will be closed first, which in turn will result in the datafeed being closed.

Closes #138010

When the stop datafeed API is called with close_job=true the job associated with the datafeed will be closed first, which in turn will result in the datafeed being closed.

Closes elastic#138010
@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Nov 26, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine
Copy link
Collaborator

Hi @edsavage, I've created a changelog YAML for you.

@edsavage edsavage requested a review from valeriy42 November 27, 2025 03:12
Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Couple of minor comments. The change is well tested

Copy link
Contributor

@valeriy42 valeriy42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on implementing this PR! I like how clean it is. I have only a couple of suggestions and questions.

Comment on lines 242 to 244
logger.warn("Failed to close jobs (and associated datafeeds): {}", jobIds);
}
delegate.onResponse(new StopDatafeedAction.Response(true));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to fail the request if any job failed to close? Right now, the call always returns Response(true).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a good idea. Thanks!

Copy link
Contributor

@valeriy42 valeriy42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Good work!

@edsavage edsavage merged commit 1db468b into elastic:main Dec 3, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EnableJiraSync >enhancement :ml Machine learning Team:ML Meta label for the ML team v9.3.0

4 participants