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

Only load a plugin once from the classpath #11301

Merged
merged 1 commit into from May 22, 2015

Conversation

jaymode
Copy link
Member

@jaymode jaymode commented May 22, 2015

Today, when loading plugins from the classpath we take the enumeration
given to us by the classloader and attempt to load every URL. This can
cause issues as certain classloaders, such as groovy's, will return the same
URL multiple times in the enumeration. When this happens, startup can fail
with guice errors as bindings have already been registered.

To workaround this, we create a set from the URLs returned by the classloader
to provide uniqueness.

@kimchy
Copy link
Member

kimchy commented May 22, 2015

LGTM

@jaymode jaymode added >bug and removed >enhancement labels May 22, 2015
@jaymode
Copy link
Member Author

jaymode commented May 22, 2015

@s1monw what do you think about backporting this to the 1.5 branch as well?

Today, when loading plugins from the classpath we take the enumeration
given to us by the classloader and attempt to load every URL. This can
cause issues as certain classloaders, such as groovy's, will return the same
URL multiple times in the enumeration. When this happens, startup can fail
with guice errors as bindings have already been registered.

To workaround this, we create a set from the URLs returned by the classloader
to provide uniqueness.
@jaymode jaymode merged commit fd7d6ca into elastic:master May 22, 2015
@kevinkluge kevinkluge removed the review label May 22, 2015
@clintongormley clintongormley added the :Core/Infra/Plugins Plugin API and infrastructure label May 25, 2015
@clintongormley clintongormley changed the title only load a plugin once from the classpath Only load a plugin once from the classpath Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants