-
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
Restrict build info loading to ES jar, not any jar #24049
Conversation
This change makes the build info initialization only try to load a jar manifest if it is the elasticsearch jar. Anything else (eg a repackaged ES for use of transport client in an uber jar) will contain "Unknown" for the build info as it does for tests currently.
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.
The change looks good to me and I think we should get it in as soon as we can, but I would like to manually verify that this addresses the issues for deploying to an application container before this integrated and I opened #24050 so that having to do this manually is a one-time thing.
So manual testing shows that we'll need a little more here. We can discuss tomorrow. |
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.
Just one thing.
final URL url = getElasticsearchCodebase(); | ||
if (url.toString().endsWith(".jar")) { | ||
final String urlStr = url.toString(); | ||
if (urlStr.startsWith("file://") && (urlStr.endsWith(esPrefix + ".jar") || urlStr.endsWith(esPrefix + "-SNAPSHOT.jar"))) { |
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.
This isn't quite right. Wrap the ends with checks in parentheses.
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.
So it's starts with and (ends with or ends with).
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.
Also I think it is one slash only, annoyingly.
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.
Not sure what you mean.
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.
Oh, I misread it (mobile phone, sorry). The only thing that needs to change then is file:// -> file:/.
I've tested this change by deploying a war that uses the |
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.
This change makes the build info initialization only try to load a jar manifest if it is the elasticsearch jar. Anything else (eg a repackaged ES for use of transport client in an uber jar) will contain "Unknown" for the build info as it does for tests currently. fixes #21955
This change makes the build info initialization only try to load a jar manifest if it is the elasticsearch jar. Anything else (eg a repackaged ES for use of transport client in an uber jar) will contain "Unknown" for the build info as it does for tests currently. fixes #21955
This change makes the build info initialization only try to load a jar manifest if it is the elasticsearch jar. Anything else (eg a repackaged ES for use of transport client in an uber jar) will contain "Unknown" for the build info as it does for tests currently. fixes #21955
* master: (41 commits) Remove awaits fix from evil JNA native tests Correct handling of default and array settings Build: Switch jna dependency to an elastic version (elastic#24081) fix CategoryContextMappingTests compilation bugs testConcurrentGetAndSetOnPrimary - fix a race condition between indexing and updating value map Allow different data types for category in Context suggester (elastic#23491) Restrict build info loading to ES jar, not any jar (elastic#24049) Remove more hidden file leniency from plugins Register error listener in evil logger tests Detect using logging before configuration [DOCS] Added note about Elastic Cloud to improve 'elastic aws' SERP results. Add version constant for 5.5 (elastic#24075) Add unit tests for NestedAggregator (elastic#24054) Add more debugging information to rethrottles Tests: Use random analyzer only on string fields in Match/MultiMatchBuilderTests Cleanup outdated comments for fixing up pom dependencies (elastic#24056) S3 Repository: Eagerly load static settings (elastic#23910) Reject duplicate settings on the command line Wildcard cluster names for cross cluster search (elastic#23985) Update scripts/security docs for sandboxed world (elastic#23977) ...
This change makes the build info initialization only try to load a jar
manifest if it is the elasticsearch jar. Anything else (eg a repackaged
ES for use of transport client in an uber jar) will contain "Unknown"
for the build info as it does for tests currently.
fixes #21955