Only close temporary jars to avoid poisoning global jar file cache#6273
Merged
headius merged 1 commit intojruby:masterfrom Jun 9, 2020
Merged
Only close temporary jars to avoid poisoning global jar file cache#6273headius merged 1 commit intojruby:masterfrom
headius merged 1 commit intojruby:masterfrom
Conversation
This is another alternative fix for the issues reported in jruby#6218 and diagnosed as a JDK bug in the following OpenJDK issue: https://bugs.openjdk.java.net/browse/JDK-8246714 Rather than avoid the caching or leave all jar files open, this patch takes a conservative approach. Temporary jar files that we unpack must be deleted and should be closed even if globally cached, since they will not conflict with other jar cache consumers. Normal jars on the filesystem will remain unclosed, to avoid impacting other consumers of the global jar cache. This does mean that once a jar is opened by JRuby via our classloader, it will not be closed until the process terminates. Because this is a new behavior that may not be desirable in some situations, this patch also adds a new property: jruby.ji.close.classloader=true will close the per-runtime classloader and any jar file instances it has cached, as before. The default is "false" and in that case only the temporary jars will be closed. This fixes jruby#6218
This was referenced Jun 9, 2020
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is another alternative fix for the issues reported in #6218
and diagnosed as a JDK bug in the following OpenJDK issue:
https://bugs.openjdk.java.net/browse/JDK-8246714
Rather than avoid the caching or leave all jar files open, this
patch takes a conservative approach. Temporary jar files that we
unpack must be deleted and should be closed even if globally
cached, since they will not conflict with other jar cache
consumers. Normal jars on the filesystem will remain unclosed, to
avoid impacting other consumers of the global jar cache.
This does mean that once a jar is opened by JRuby via our
classloader, it will not be closed until the process terminates.
Because this is a new behavior that may not be desirable in some
situations, this patch also adds a new property:
jruby.ji.close.classloader=true will close the per-runtime
classloader and any jar file instances it has cached, as before.
The default is "false" and in that case only the temporary jars
will be closed.
This fixes #6218