RFR: 8292269: Replace FileMapInfo::fail_continue() with Unified Logging [v7]

David Holmes dholmes at openjdk.org
Tue Feb 28 00:26:26 UTC 2023


On Wed, 22 Feb 2023 01:10:08 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

>> The current logging method FileMapInfo::fail_continue() method reports the reason when the CDS archive cannot be mapped and has variable behavior depending on the -Xshare mode. Logging calls are divided primarily between the "warning" and "info" channels, where the "info" channel was used to reduce the number of printed logs for expected and normal failures. 
>> 
>> Logging will now shift toward Unified Logging, so `fail_continue()` will be replaced with `log_info(cds)` and `log_warning(cds)`. Some genuine failures will be logged to the warning channel for better visibility. Upon actual failures, the VM will exit at MetaspaceShared::initialize_runtime_shared_and_meta_spaces() unless it is otherwise necessary. Relevant tests are updated to accommodate this change. Verified with tier1-4 tests
>
> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Ioi patch and added error

Looks good. Thanks.

A couple of minor queries on the tests.

One nit with the exit strategy - partly pre-existing - it is not clear why `vm_exit_during_initialization` is used in some places and `fail_stop` in others. It seems to me that `fail_stop` may no longer be required given the code doesn't use the tty anyway. But consistency would be nice.

src/hotspot/share/cds/metaspaceShared.cpp line 953:

> 951:       vm_exit_during_initialization("Unable to use shared archive.");
> 952:     } else if (RequireSharedSpaces) {
> 953:       FileMapInfo::fail_stop("Unable to map shared spaces");

Looks odd to use `fail_stop` here and `vm_exit_during_initialization` just before it. ??

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/SharedArchiveFileOption.java line 256:

> 254:                  "--patch-module",
> 255:                  "foo.bar=xxx",
> 256:                  "-Xshare:auto",

Why remove this?

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/UsedAllArchivedLambdas.java line 67:

> 65:             use_whitebox_jar,
> 66:             "-Xlog:cds=debug",
> 67:             "-Xshare:auto",

Why add this?

-------------

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12419


More information about the hotspot-runtime-dev mailing list