-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 for JarHell Bootstrap Check can yield false positives #76217
Conversation
…o added a unit test to test io error msg
throw new IllegalStateException("failed to load plugin " + bundle.plugin.getName() + " due to io error, caused when checking for Jar Hell", ioe); | ||
} catch (final URISyntaxException urie) { | ||
throw new IllegalStateException("failed to load plugin " + bundle.plugin.getName() + " due to malformed uri, caused when checking for Jar Hell", urie); | ||
} catch (final Exception e) { |
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 think the original problem could still occur for another unknown exception. Instead of specializing other exception types, let’s specialize the only one we throw for jar hell, IllegalStateException. Then the general exception can catch all the others with a different message like “failed to load plugin foo while checking for jar hell”.
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.
Yes, it makes sense. I have made the changes to check only for IllegalStateException that gets specifically thrown, the general exception catches all the others
@elasticmachine ok to test |
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.
Thanks for the contribution @BalasubramanyamEvani. LGTM
When checking for jarhell while loading plugins, exceptions other than jarhell can occur. The wrapped exception message in these cases refers to jarhell failing, but in actuality it was eg a filesystem error. This commit separates the two cases, jarhell failure and other failure.
💚 Backport successful
|
When checking for jarhell while loading plugins, exceptions other than jarhell can occur. The wrapped exception message in these cases refers to jarhell failing, but in actuality it was eg a filesystem error. This commit separates the two cases, jarhell failure and other failure. Co-authored-by: E Bala <balasubramanyam.evani@gmail.com>
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Possible fix for Issue #75701 | JarHell Bootstrap Check can yield false positives |
Changes made:
Have you signed the contributor license agreement?
Yes
Have you followed the contributor guidelines? Yes
If submitting code, have you built your formula locally prior to submission with
gradle check
?Yes
If submitting code, is your pull request against master? Unless there is a good reason otherwise, we prefer pull requests against master and will backport as needed.
Yes
If submitting code, have you checked that your submission is for an OS and architecture that we support?
I think so
If you are submitting this code for a class then read our [policy] (https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md#contributing-as-part-of-a-class) for that.
No