JDK-8280041 : Retry loop issues in java.io.ClassCache
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io:serialization
  • Affected Version: 11,17,18,19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-01-14
  • Updated: 2022-04-01
  • Resolved: 2022-01-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 18 JDK 19
11.0.16Fixed 17.0.4Fixed 18.0.2Fixed 19 b07Fixed
Related Reports
Relates :  
Description
JDK-8277072 introduced java.io.ClassCache, but there seem to be at least two issues with it:
 *) The cache cannot disambiguate between cleared SoftReference and the accidental passing of "null" value; in that case, the retry loop would spin indefinitely;
 *) If retry loop would spin several times, every time discovering a cleared SoftReference, it would create and register new SoftReference on the ReferenceQueue. However, it would not *drain* the RQ in the loop; in that case, we might have the unbounded garbage accumulating in RQ;

WIP: https://github.com/openjdk/jdk/pull/7092
Comments
Fix-request (jdk11u): This backport fixes a number of issues with the preceding change for JDK-8277072. The original change has baked for several weeks in jdk19. One of the tests required some changes because the API Reference.refersTo() does not exist in JDK 11.
14-03-2022

Fix-request (jdk18u, jdk17u): This backport fixes a number of issues with the preceding change for JDK-8277072. The original change has baked for several weeks in jdk19 and applies cleanly.
14-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/887 Date: 2022-03-14 10:47:34 +0000
14-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk17u-dev/pull/245 Date: 2022-03-14 10:46:25 +0000
14-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk17u-dev/pull/244 Date: 2022-03-14 10:39:18 +0000
14-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk18u/pull/46 Date: 2022-03-14 09:44:00 +0000
14-03-2022

Changeset: cebaad1c Author: Aleksey Shipilev <shade@openjdk.org> Date: 2022-01-25 19:22:07 +0000 URL: https://git.openjdk.java.net/jdk/commit/cebaad1c94c301304fd146526cac95bfeaac66bf
25-01-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7092 Date: 2022-01-14 19:27:18 +0000
14-01-2022