-
Notifications
You must be signed in to change notification settings - Fork 25.4k
[Inference API] Put back legacy EIS URL setting #121207
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
[Inference API] Put back legacy EIS URL setting #121207
Conversation
Pinging @elastic/search-inference-team (Team:Search - Inference) |
Hi @demjened, I've created a changelog YAML for you. |
Pinging @elastic/search-eng (Team:SearchOrg) |
…:demjened/elasticsearch into demjened/put-back-legacy-eis-url-setting
@@ -54,7 +63,7 @@ public static List<Setting<?>> getSettingsDefinitions() { | |||
} | |||
|
|||
public String getElasticInferenceServiceUrl() { | |||
return elasticInferenceServiceUrl; | |||
return Strings.isEmpty(elasticInferenceServiceUrl) ? eisGatewayUrl : elasticInferenceServiceUrl; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 "".
* Put back legacy EIS URL setting * Update docs/changelog/121207.yaml * Fallback logic to legacy URL * Add unit tests
💚 Backport successful
|
Fix after #120842. Putting back obsolete setting while Cloud is still setting it.