Skip to content

Conversation

@ChrisHegarty
Copy link
Contributor

@ChrisHegarty ChrisHegarty commented Jul 18, 2022

This change disables URLConnection caching in SPIClassIterator - similar to what j.u.ServiceLoader does.

Resources accessed in jar file, through the URLConnection API, cache by default. In terms of JarURLConnections, this means retaining an open handle to the underlying jar file. This open handle is problematic when attempting to delete the jar file, on Windows. Disabling the jar file cache, for the URLConnections in SPIClassLoader should not negatively affect performance in any substantial way - since there are just a few service configuration files per jar.

The "workaround" here, disabling the cache per JAR URLConnection, is very common, and a consequence of the longstanding behaviour of the JarURLConnection API, as well as the URLClassLoader API.

closes #88275

@ChrisHegarty ChrisHegarty self-assigned this Jul 18, 2022
@ChrisHegarty ChrisHegarty added :Core/Infra/Plugins Plugin API and infrastructure Team:Core/Infra Meta label for core/infra team labels Jul 18, 2022
@ChrisHegarty ChrisHegarty changed the title Disable url connection caching in SPIClassIterator Disable URL connection caching in SPIClassIterator Jul 18, 2022
@ChrisHegarty ChrisHegarty marked this pull request as ready for review July 18, 2022 12:59
@elasticmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @ChrisHegarty, I've created a changelog YAML for you.

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Core/Infra/Plugins Plugin API and infrastructure Team:Core/Infra Meta label for core/infra team v8.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] PluginsServiceTests classMethod failing

5 participants