-
Notifications
You must be signed in to change notification settings - Fork 74
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
Fix error when creating a view with invalid mappings or settings #4365
Conversation
@@ -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 |
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.
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) |
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.
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 } |
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.
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
Related to #4313