JDK-8284692 : Add option to enable/disable shared class paths check at CDS runtime
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2022-04-11
  • Updated: 2022-09-08
  • Resolved: 2022-09-08
Related Reports
Duplicate :  
Relates :  
Description
CDS runtime checks the recorded shared class paths as part of the archive validation.  The shared classpath checks include:

- Compare the recorded paths string with the runtime paths string
- Compare the recorded size for each JAR file in the shared class paths with the current file size
- Compare the recorded last modified time (mtime) for each JAR file in the shared class paths with the current file mtime

mtime may not be meaningful and not the recorded last modified time in some cases. Path string may be different at dump time and runtime. These could cause false failures during the shared classpath check.

In some environments, we can still ensure an existing CDS shared archive is up-to-date with a release and deployment process for related JAR and JSA files, without the shared classpath checks. In those cases, providing a VM option (e.g. -XX:-ValidateSharedClassPaths) to disable the check would be helpful.
Comments
I had forgotten this has already recorded. Closing this as a duplicate of JDK-8293526.
08-09-2022

Alternative proposal to keep the checks but make them more flexible, so we can still prevent innocent mistakes when an old CDS archive is deployed with updated JAR files: https://mail.openjdk.org/pipermail/hotspot-runtime-dev/2022-September/057305.html
01-09-2022