URLClassLoader poisons the global JarFile cache
Charles Oliver Nutter
headius at headius.com
Sat Jun 6 01:45:41 UTC 2020
Hey folks, with some help from Claes Redestad I've filed an issue with
analysis and reproduction of the legendary "zip file closed" error.
https://bugs.openjdk.java.net/browse/JDK-8246714
It turns out that URLClassLoader is just plain broken when used to
access jar files (which means this bug affects basically every
application out there). Two threads using their own URLClassLoader
instances to access the same jar file will likely lead to random
errors, due to URLClassLoader improperly closing JarFile instances in
the global cache.
I'm posting here to bring attention to this issue, because it affects
all versions of OpenJDK at least back to Java 7, and the workarounds
are gross and only partly effective. We've struggled for years to find
the cause of this issue, which occurs randomly in JRuby CI builds and
has been reported by numerous users.
Maybe we'll finally be able to get this stinker of a bug fixed!
- Charlie
More information about the core-libs-dev
mailing list