RFR: 8284313: Improve warning messages when CDS archive fails to load [v2]
Ioi Lam
iklam at openjdk.org
Fri Aug 12 00:04:34 UTC 2022
On Thu, 11 Aug 2022 22:15:21 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> src/hotspot/share/cds/filemap.cpp line 468:
>>
>>> 466: log_warning(cds)("%s timestamp has changed.", name);
>>> 467: } else {
>>> 468: log_warning(cds)("%s size has changed.", name);
>>
>> Shouldn't these be incorporated into the message the fail_continue will report under log_info? By themselves the log_warning output will look odd, with no context.
>
> Thanks for the review. I've added the message from the fail_continue to the warning in case CDS logging is not enabled. Tests are also updated to look for the warning message.
Background:
When -Xshare:auto is used, `FileMapInfo::fail_continue()` prints the diagnostic message to the Info channel instead of Warning. This was necessary in the past because CDS would failed to load for many reasons (e.g., failure to mmap due to ASLR) that are not the fault of the user. On Windows the failure rate could be as much as 50%. If we printed the message in the Warning channel, the user would be overwhelmed and would ultimately ignore the warnings, rendering them useless.
However, currently CDS is much more reliable. We should consider changing the failure logs to use the Warning channel instead.
I have filed [JDK-8292269](https://bugs.openjdk.org/browse/JDK-8292269).
-------------
PR: https://git.openjdk.org/jdk/pull/9823
More information about the hotspot-runtime-dev
mailing list