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

[DOCS] regex are enabled by default since 7.10 and introduce a new circuit breaker #75199

Closed
CamiloSierraH opened this issue Jul 10, 2021 · 2 comments · Fixed by #76048
Closed
Assignees
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >docs General docs changes Team:Core/Infra Meta label for core/infra team Team:Docs Meta label for docs team

Comments

@CamiloSierraH
Copy link

CamiloSierraH commented Jul 10, 2021

In earlier version of Elasticsearch (tested v7.7) we can not use regex unless the setting script.painless.regex.enabled is true.

since v7.10 the regex are allowed by default, and we will have a circuit breaker in case the regex we try to execute is too complex:

caused_by" : {
          "type" : "circuit_breaking_exception",
          "reason" : "[scripting] Regular expression considered too many characters, 
           pattern: [[a-f0-9]{32}$], limit factor: [6], char limit: [240], count: [241],
           wrapped: [xxx], this limit can be changed 
           by changed by the [script.painless.regex.limit-factor] setting",

But If you set script.painless.regex.enabled to true this circuit breaker will not be triggered anymore and the complex regex will be accepted and executed.

We also have no documentation related to the setting "script.painless.regex.limit-factor".
Maybe we can take the doc from CompilerSettings class and add some examples and details to the documentation.
https:/elastic/elasticsearch/blob/master/modules/lang-painless/src/main/java/org/elasticsearch/painless/CompilerSettings.java

 * Are regexes enabled? If {@code true}, regexes are enabled and unlimited by the limit factor.  If {@code false}, they are completely
     * disabled. If {@code use-limit}, the default, regexes are enabled but limited in complexity according to the
     * {@code script.painless.regex.limit-factor} setting.
@CamiloSierraH CamiloSierraH added >docs General docs changes needs:triage Requires assignment of a team area label labels Jul 10, 2021
@elasticmachine elasticmachine added the Team:Docs Meta label for docs team label Jul 10, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@gwbrown gwbrown added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache and removed needs:triage Requires assignment of a team area label labels Jul 13, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Jul 13, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@jrodewig jrodewig self-assigned this Aug 3, 2021
jrodewig added a commit that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to #63029.

Closes #75199.
elasticsearchmachine pushed a commit to elasticsearchmachine/elasticsearch that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to elastic#63029.

Closes elastic#75199.
elasticsearchmachine pushed a commit to elasticsearchmachine/elasticsearch that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to elastic#63029.

Closes elastic#75199.
elasticsearchmachine pushed a commit to elasticsearchmachine/elasticsearch that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to elastic#63029.

Closes elastic#75199.
elasticsearchmachine pushed a commit to elasticsearchmachine/elasticsearch that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to elastic#63029.

Closes elastic#75199.
elasticsearchmachine pushed a commit to elasticsearchmachine/elasticsearch that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to elastic#63029.

Closes elastic#75199.
elasticsearchmachine added a commit that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to #63029.

Closes #75199.

Co-authored-by: James Rodewig <[email protected]>
elasticsearchmachine added a commit that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to #63029.

Closes #75199.

Co-authored-by: James Rodewig <[email protected]>
elasticsearchmachine added a commit that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to #63029.

Closes #75199.

Co-authored-by: James Rodewig <[email protected]>
jrodewig added a commit that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to #63029.

Closes #75199.

Co-authored-by: James Rodewig <[email protected]>
elasticsearchmachine added a commit that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to #63029.

Closes #75199.

Co-authored-by: James Rodewig <[email protected]>
jrodewig added a commit that referenced this issue Aug 4, 2021
Documents the `script.painless.regex.enabled` and
`script.painless.regex.limit-factor` cluster settings.

Relates to #63029.

Closes #75199.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >docs General docs changes Team:Core/Infra Meta label for core/infra team Team:Docs Meta label for docs team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants