-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Wrap "Pattern too complex" exception into an IllegalArgumentException #109173
Wrap "Pattern too complex" exception into an IllegalArgumentException #109173
Conversation
Hi @afoucret, I've created a changelog YAML for you. |
Pinging @elastic/es-search (Team:Search) |
settings: | ||
index: | ||
analysis: | ||
analyzer: |
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.
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.
GH does not render it well - but this is an actual case where we know Pattern::compile
throws an OutOfMemoryError
so I think it is fine to keep it. Might be worth adding a comment here for folks that might read this code in the future? @afoucret
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.
I moved this test to a more appropriate place and added a comment to it
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.
Looks reasonable to me with one question about release notes.
💚 Backport successful
|
The behavior of
java.util.regex.Pattern.:compile
has been updated in a way that make it possible too handle OutOfMemoryError errors cause by too complex pattern more gracefully and make them recoverable.