-
Notifications
You must be signed in to change notification settings - Fork 25k
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
[Transform] Fix casting in ExceptionRootCauseFinder #66123
[Transform] Fix casting in ExceptionRootCauseFinder #66123
Conversation
Method `getRootCauseException` is checking whether the unwrapped exception is an instance of `SearchPhaseExecutionException` but then proceeds to cast the parent exception. This would lead to a casting error. This commit fixes this and adds a unit test to guard it.
Pinging @elastic/ml-core (:ml/Transform) |
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.
LGTM
Good spot!
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.
LGTM, good spot.
I did some research on the code, fortunately this case never happens, SearchPhaseExecutionException
is never wrapped and never meant to be wrapped in a ElasticsearchWrapperException
. Instead of checking unwrappedThrowable
its also possible to check t
and unwrap it, if its not a SPEE
. However, it does not to hurt to do it this way.
I suggest to re-label it as |
Method `getRootCauseException` is checking whether the unwrapped exception is an instance of `SearchPhaseExecutionException` but then proceeds to cast the parent exception. This would lead to a casting error. This commit fixes this and adds a unit test to guard it. Backport of elastic#66123
Method
getRootCauseException
is checking whether the unwrappedexception is an instance of
SearchPhaseExecutionException
but thenproceeds to cast the parent exception. This would lead to a casting
error. This commit fixes this and adds a unit test to guard it.