Skip to content

[Inference API] Put back legacy EIS URL setting#121207

Merged
demjened merged 6 commits intoelastic:mainfrom
demjened:demjened/put-back-legacy-eis-url-setting
Jan 29, 2025
Merged

[Inference API] Put back legacy EIS URL setting#121207
demjened merged 6 commits intoelastic:mainfrom
demjened:demjened/put-back-legacy-eis-url-setting

Conversation

@demjened
Copy link
Contributor

@demjened demjened commented Jan 29, 2025

Fix after #120842. Putting back obsolete setting while Cloud is still setting it.

@demjened demjened added >bug :SearchOrg/Inference Label for the Search Inference team v9.0.0 v8.18.0 labels Jan 29, 2025
@elasticsearchmachine elasticsearchmachine added Team:SearchOrg Meta label for the Search Org (Enterprise Search) Team:Search - Inference labels Jan 29, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-inference-team (Team:Search - Inference)

@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-eng (Team:SearchOrg)

@demjened demjened requested review from maxjakob and vidok January 29, 2025 16:27
@demjened demjened added the auto-backport Automatically create backport pull requests when merged label Jan 29, 2025
…:demjened/elasticsearch into demjened/put-back-legacy-eis-url-setting

public String getElasticInferenceServiceUrl() {
return elasticInferenceServiceUrl;
return Strings.isEmpty(elasticInferenceServiceUrl) ? eisGatewayUrl : elasticInferenceServiceUrl;
Copy link
Contributor

Choose a reason for hiding this comment

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

Post-approval thought: can elasticInferenceServiceUrl be null and what does Strings.isEmpty return in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Per Javadocs (it's wrongly referenced as StringUtils there):

     * StringUtils.isEmpty(null) = true
     * StringUtils.isEmpty("") = true
     * StringUtils.isEmpty(" ") = false
     * StringUtils.isEmpty("Hello") = false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also if a Setting is initialized like EIS_GATEWAY_URL = Setting.simpleString(...) (which is what we do here), the default value will be "".

@demjened demjened merged commit 50376ef into elastic:main Jan 29, 2025
16 checks passed
demjened added a commit to demjened/elasticsearch that referenced this pull request Jan 29, 2025
* Put back legacy EIS URL setting

* Update docs/changelog/121207.yaml

* Fallback logic to legacy URL

* Add unit tests
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x
@demjened demjened deleted the demjened/put-back-legacy-eis-url-setting branch January 29, 2025 22:31
elasticsearchmachine pushed a commit that referenced this pull request Jan 29, 2025
* Put back legacy EIS URL setting

* Update docs/changelog/121207.yaml

* Fallback logic to legacy URL

* Add unit tests
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 :SearchOrg/Inference Label for the Search Inference team Team:Search - Inference Team:SearchOrg Meta label for the Search Org (Enterprise Search) v8.18.0 v9.0.0

4 participants