-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Handle providers of optional services in ubermodule classloader #91217
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
Merged
williamrandolph
merged 9 commits into
elastic:main
from
williamrandolph:sp/service-loading-fix
Nov 15, 2022
Merged
Handle providers of optional services in ubermodule classloader #91217
williamrandolph
merged 9 commits into
elastic:main
from
williamrandolph:sp/service-loading-fix
Nov 15, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubermodule descriptor, we must make sure that any optional dependencies match up to services that are defined in the code. If we naively declare that our module uses any service that is implemented by one of its jars, we might fail to load the plugin because the original implementation is not included in our bundle. Here we add a fairly detailed test scenario for required and optional services defined outside the bundle, as well as for services defined within the bundle, either by module declaration or by META-INF/services entry.
@elasticmachine test this please |
declaring that the ubermodule owns packages for missing optional dependencies, just don't add services from missing optional dependencies or their providers to the ubermodule declaration.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
ubermodule classloader to load the repository-azure Elasticsearch plugin, so the change to the security policy is premature.
ChrisHegarty
approved these changes
Nov 10, 2022
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.
weizijun
added a commit
to weizijun/elasticsearch
that referenced
this pull request
Nov 15, 2022
* main: (163 commits) [DOCS] Edits frequent items aggregation (elastic#91564) Handle providers of optional services in ubermodule classloader (elastic#91217) Add `exportDockerImages` lifecycle task for exporting docker tarballs (elastic#91571) Fix CSV dependency report output file location in DRA CI job Fix variable placeholder for Strings.format calls (elastic#91531) Fix output dir creation in ConcatFileTask (elastic#91568) Fix declaration of dependencies in DRA snapshots CI job (elastic#91569) Upgrade Gradle Enterprise plugin to 3.11.4 (elastic#91435) Ingest DateProcessor (small) speedup, optimize collections code in DateFormatter.forPattern (elastic#91521) Fix inter project handling of generateDependenciesReport (elastic#91555) [Synthetics] Add synthetics-* read to fleet-server (elastic#91391) [ML] Copy more settings when creating DF analytics destination index (elastic#91546) Reduce CartesianCentroidIT flakiness (elastic#91553) Propagate last node to reinitialized routing tables (elastic#91549) Forecast write load during rollovers (elastic#91425) [DOCS] Warn about potential overhead of named queries (elastic#91512) Datastream unavailable exception metadata (elastic#91461) Generate docker images and dependency report in DRA ci job (elastic#91545) Support cartesian_bounds aggregation on point and shape (elastic#91298) Add support for EQL samples queries (elastic#91312) ... # Conflicts: # x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/downsample/RollupShardIndexer.java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
:Core/Infra/Plugins
Plugin API and infrastructure
>non-issue
Team:Core/Infra
Meta label for core/infra team
test-windows
Trigger CI checks on Windows
v8.6.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It is possible for a service provider to implement a service defined in optional (compile-time) dependency. When creating an ubermodule, we need to make sure that we do not declare a service if its optional dependency is missing at run-time, because if we try to do this we get a failure at the module graph construction stage. To do this, we make sure that the service class or interface is part of an exported package that the ubermodule can read.