Skip to content

Conversation

@prwhelan
Copy link
Member

num_threads cannot be updated and should result in a validation error

Fix #137129


{
  "error": {
    "root_cause": [
      {
        "type": "validation_exception",
        "reason": "Validation Failed: 1: [num_threads] cannot be updated;"
      }
    ],
    "type": "validation_exception",
    "reason": "Validation Failed: 1: [num_threads] cannot be updated;"
  },
  "status": 400
}

num_threads cannot be updated and should result in a validation error

Fix elastic#137129
@prwhelan prwhelan added >bug :ml Machine learning Team:ML Meta label for the ML team auto-backport Automatically create backport pull requests when merged v9.3.0 branch:9.2 branch:9.1 branch:8.19 labels Nov 14, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@prwhelan prwhelan marked this pull request as ready for review November 14, 2025 21:17
@prwhelan prwhelan requested a review from Copilot November 14, 2025 21:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds validation to prevent updating the num_threads parameter in Elasticsearch internal service settings, addressing issue #137129. When users attempt to update this parameter, they will now receive a clear validation error instead of potentially experiencing undefined behavior.

Key changes:

  • Added validation logic to reject num_threads updates in service settings
  • Added test coverage to verify the validation error is thrown correctly
  • Added changelog entry documenting this bug fix

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
ElasticsearchInternalServiceSettings.java Added validation check to throw ValidationException when num_threads update is attempted
ElasticsearchInternalServiceTests.java Added test case to verify num_threads update validation
docs/changelog/138122.yaml Added changelog entry for this bug fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@elasticsearchmachine
Copy link
Collaborator

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

@prwhelan prwhelan enabled auto-merge (squash) November 17, 2025 19:41
@prwhelan prwhelan merged commit 2b3c8e1 into elastic:main Nov 17, 2025
34 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.2
8.19 Commit could not be cherrypicked due to conflicts
9.1 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 138122

prwhelan added a commit to prwhelan/elasticsearch that referenced this pull request Nov 17, 2025
num_threads cannot be updated and should result in a validation error

Fix elastic#137129
elasticsearchmachine pushed a commit that referenced this pull request Nov 17, 2025
num_threads cannot be updated and should result in a validation error

Fix #137129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug :ml Machine learning Team:ML Meta label for the ML team v9.2.2 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ML] no error when updating num_threads in inference endpoint

3 participants