Skip to content
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

Fix error when creating a view with invalid mappings or settings #4365

Merged

Conversation

imsdu
Copy link
Contributor

@imsdu imsdu commented Oct 12, 2023

Related to #4313

@@ -20,8 +18,6 @@ plugins.elasticsearch {
prefix = ${app.defaults.indexing.prefix}
# configuration of the maximum number of view references allowed on an aggregated view
max-view-refs = 20
# the maximum idle duration in between events on the indexing stream after which the stream will be stopped (min. 10 minutes).
idle-timeout = 30 minutes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unused

@@ -53,8 +53,8 @@ class ElasticSearchPluginModule(priority: Int) extends ModuleDef {
make[ElasticSearchViewsConfig].from { ElasticSearchViewsConfig.load(_) }

make[HttpClient].named("elasticsearch-client").from {
(cfg: ElasticSearchViewsConfig, as: ActorSystem[Nothing], sc: Scheduler) =>
HttpClient()(cfg.client, as.classicSystem, sc)
val httpConfig = HttpClientConfig.noRetry(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.

The retry strategy was responsible for timeouts.
We don't need retries when interacting with Elasticsearch so it is better to let things fail when it returns an error

val invalidMapping =
json"""{"mapping": "fail"}"""
val payload = json"""{ "@type": "ElasticSearchView", "mapping": $invalidMapping }"""
deltaClient.put[Json](s"/views/$fullId/invalid", payload, ScoobyDoo) { expectBadRequest }
Copy link
Contributor

Choose a reason for hiding this comment

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

The invalid segment reads as if the view id is invalid, when the issue is the payload. The payload could be called payloadWithInvalidMapping, and the view id something else than invalid. Similar comment on the other test

@olivergrabinski olivergrabinski merged commit 9b96b5e into BlueBrain:master Oct 13, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants