-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b159
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8176641 | 10 | Chris Hegarty | P3 | Resolved | Fixed | b03 |
Comment from JDK-8163449 reporter:
I'm afraid that the current fix is not sufficient for JARUrlConnection.
The problem is that sun.net.www.protocol.jar.JarURLConnection passes all of the [g|s]et[Default]UseCaches() method calls to the wrapped URLConnection which is an instance of FileURLConnection. This means any attempt to control caching for just JAR URLs fails. "jar" always ends up being treated like "file" which is exactly the case we are trying to avoid. We want "file" to cache for performance but we don't want "jar" to cache so we can avoid the associated file locking issues.
Simple test here:
https://github.com/markt-asf/memory-leaks/blob/master/src/org/apache/markt/leaks/net/TestJava9CacheFix.java
Expected oputput:
true
true
false
false
Actual Output :
true
true
true
true
I'm afraid that the current fix is not sufficient for JARUrlConnection.
The problem is that sun.net.www.protocol.jar.JarURLConnection passes all of the [g|s]et[Default]UseCaches() method calls to the wrapped URLConnection which is an instance of FileURLConnection. This means any attempt to control caching for just JAR URLs fails. "jar" always ends up being treated like "file" which is exactly the case we are trying to avoid. We want "file" to cache for performance but we don't want "jar" to cache so we can avoid the associated file locking issues.
Simple test here:
https://github.com/markt-asf/memory-leaks/blob/master/src/org/apache/markt/leaks/net/TestJava9CacheFix.java
Expected oputput:
true
true
false
false
Actual Output :
true
true
true
true
- backported by
-
JDK-8176641 Per-protocol cache setting not working for JAR URLConnection
-
- Resolved
-
- relates to
-
JDK-8163449 Allow per protocol setting for URLConnection defaultUseCaches
-
- Closed
-