RFR: 8292269: Log more CDS failure messages in the warning channel
Ioi Lam
iklam at openjdk.org
Wed Feb 8 00:03:49 UTC 2023
On Tue, 7 Feb 2023 22:30:31 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> In that case I return to "It is better to name a method by what it does do rather than what it doesn't." So `fail_continue` and `fail_continue_warn`?
>
> To be in line with @dholmes-ora's suggestion, would we use the names `notify_failure` and `notify_failure_warn` ? That seems a bit redundant and ambiguous to me, so I propose `notify_failure` for the warning channel and `log_failure` for the info channel and other possible levels.
Actually, after thinking about this more, I think we should rewrite all the calls to `FileMapInfo::fail_continue()` with `log_xxx()` calls. This will bring the CDS logging code up-to-date and we can get rid of the convoluted `fail_continue()` function.
`fail_continue()` was ancient code from the days when Unified Logging wasn't available. It currently does three things:
- (a) If `PrintSharedArchiveAndExit` or `RequireSharedSpaces` are enabled, always log the message so it's visible to the user
- (b) If `RequireSharedSpaces` is enabled, exit the VM immediately
- Otherwise, log the message to the `cds` channel.
As mentioned in [JDK-8292269](https://bugs.openjdk.org/browse/JDK-8292269), we want to log some of the cds failure messages to the `info` channel, to avoid warning messages when the failure is expected (i.e., when `-XX:-UseCompressedClassPointers` is specified). My proposal is change all the `fail_continue()` calls to `log_info(cds)` or `log_warning(cds)`
The reason for (a) is: `PrintSharedArchiveAndExit` is for diagnosing problems with the CDS archive; `RequireSharedSpaces`, which is driven by the `-Xshare:on` command-line flag, which should be used only in the regression test suite (see [here](https://docs.oracle.com/en/java/javase/17/vm/class-data-sharing.html)). In both these cases, we can simply force the `cds` logging level to `info` inside arguments.cpp (using `LogConfiguration::configure_stdout()`).
For (b), we don't have to exit immediately when the error is detected. We can exit the VM in `MetaspaceShared::initialize_runtime_shared_and_meta_spaces()` when `result == MAP_ARCHIVE_SUCCESS`.
-------------
PR: https://git.openjdk.org/jdk/pull/12419
More information about the hotspot-runtime-dev
mailing list