Skip to content
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

Allow qualified exports to extended modules #95243

Merged
merged 8 commits into from
May 2, 2023

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Apr 13, 2023

In #94884 the ability to add qualified exports and opens from jars upstream of server was added. Some Elasticsearch components need to qualify their exports to another component. This commit tweaks the exports handling in PluginsService to also handle plugins with exports/opens.

In elastic#94884 the ability to add qualified exports and opens from jars
upstream of server was added. Some Elasticsearch components need to
qualify their exports to another component. This commit tweaks the
loading of the exports services so that each loaded module has the
chance to also load an exports service. It also does so for exporting of
the license package for serverless.
@rjernst rjernst added :Core/Infra/Plugins Plugin API and infrastructure >refactoring v8.8.0 labels Apr 13, 2023
@rjernst rjernst marked this pull request as ready for review April 13, 2023 20:11
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Apr 13, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I understand the change here (LGTM), but probably not enough so to approve the PR.

Thanks again for fixing this ! I tested locally and and works great.

@@ -213,5 +213,6 @@
exports org.elasticsearch.xpack.core.watcher.watch;
exports org.elasticsearch.xpack.core.watcher;

opens org.elasticsearch.license.internal; // spi
// opens org.elasticsearch.license.internal to org.elasticsearch.server; // spi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: delete the commented out opens

@rjernst
Copy link
Member Author

rjernst commented Apr 14, 2023

@elasticsearchmachine run elasticsearch-ci/part-2

@ChrisHegarty
Copy link
Contributor

I think this PR is fine as is, but there is an alternative...

In 94884, it was necessary for the libs to provide some way of modifying their exports/opens available - this was done explicitly through a service. Since the libs module is loaded in the boot layer (along with the jdk modules, server, etc), it is not possible for server to modify it's module exports directly - there is no access to a module layer controller for the boot layer.

For qualified exports/opens between ES plugin modules, then we could use the module layer controller to reify the qualified exports automagically, without the need for each plugin module to implement the exports service. We can do this since it is our server that creates the module layers for the plugin modules (where as for libs, it is the JDK that creates the boot layer).

@gmarouli gmarouli added v8.9.0 and removed v8.8.0 labels Apr 26, 2023
@rjernst
Copy link
Member Author

rjernst commented Apr 26, 2023

Thanks Chris! I applied your idea in 8b44d57, let me know what you think.

Copy link
Contributor

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this looks good. And is a great improvement as qualified exports/opens between ES modules not in the boot layer will just work automatically. 👍

@rjernst rjernst merged commit 9c370b8 into elastic:main May 2, 2023
@rjernst rjernst deleted the license_exports branch May 2, 2023 21:03
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 >refactoring Team:Core/Infra Meta label for core/infra team v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants