ingest: compile mustache template only if field includes '{{''#37207
Merged
jakelandis merged 5 commits intoelastic:masterfrom Jan 9, 2019
Merged
ingest: compile mustache template only if field includes '{{''#37207jakelandis merged 5 commits intoelastic:masterfrom
jakelandis merged 5 commits intoelastic:masterfrom
Conversation
Prior to this change, any field in an ingest node processor that supports
script templates would be compiled as mustache template regardless if they
contain a template or not. Compiling normal text as mustache templates is
harmless. However, each compilation counts against the script compilation
circuit breaker. A large number of processors without any templates or scripts
could un-intuitively trip the too many script compilations circuit breaker.
This change simple checks for '{{' in the text before it attempts to compile.
fixes elastic#37120
Collaborator
|
Pinging @elastic/es-core-features |
martijnvg
approved these changes
Jan 8, 2019
Member
martijnvg
left a comment
There was a problem hiding this comment.
👍 - there are two unused imports that make the pr build fail, but other than that LGTM.
server/src/test/java/org/elasticsearch/ingest/ValueSourceTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/ingest/ConfigurationUtilsTests.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
thanks @martijnvg ! unused imports removed. will wait for green to merge. |
Contributor
Author
|
@elasticmachine run gradle build tests 1 |
1 similar comment
Contributor
Author
|
@elasticmachine run gradle build tests 1 |
Contributor
Author
|
@elasticmachine run gradle build tests 1 |
jakelandis
added a commit
that referenced
this pull request
Jan 10, 2019
* ingest: compile mustache template only if field includes '{{''
Prior to this change, any field in an ingest node processor that supports
script templates would be compiled as mustache template regardless if they
contain a template or not. Compiling normal text as mustache templates is
harmless. However, each compilation counts against the script compilation
circuit breaker. A large number of processors without any templates or scripts
could un-intuitively trip the too many script compilations circuit breaker.
This change simple checks for '{{' in the text before it attempts to compile.
fixes #37120
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prior to this change, any field in an ingest node processor that supports
script templates would be compiled as mustache template regardless if they
contain a template or not. Compiling normal text as mustache templates is
harmless. However, each compilation counts against the script compilation
circuit breaker. A large number of processors without any templates or scripts
could un-intuitively trip the too many script compilations circuit breaker.
This change simple checks for '{{' in the text before it attempts to compile.
fixes #37120