[crac] RFR: 8364662: [CRaC] Process restore options in the common arguments parser

Timofei Pushkin tpushkin at openjdk.org
Thu Aug 7 09:34:39 UTC 2025


On Thu, 7 Aug 2025 08:05:07 GMT, Radim Vansa <rvansa at openjdk.org> wrote:

>> Options for restore are now processed during the common VM arguments parsing stage.
>> 
>> Notable improvements compared to the old code:
>> - Options from `-XX:Flags=<file>` and `-XX:VMOptionsFile=<file>` are now also considered
>> - Option aliasing is now handled correctly
>> 
>> **Behavioral change**. If `CRaCIgnoreRestoreIfUnavailable` is true it is now not an error to specify non-restore-settable options on restore — these will just be omitted from forwarding to the restored JVM. This makes it possible to specify non-restore-settable to be used after a failed restore.
>
> src/hotspot/share/runtime/arguments.cpp line 2975:
> 
>> 2973:       const size_t real_tail_len = strlen(arg) + (strlen(flag->name()) - name_len);
>> 2974:       char* const real_tail = AllocateHeap(real_tail_len + 1, MemTag::mtArguments);
>> 2975:       const int ret = jio_snprintf(real_tail, real_tail_len + 1, "%s%s", flag->name(), arg + name_len);
> 
> Where are `+BoolOpt` flags handled?

Oh, actually there are no aliased restore-settable boolean options so they don't reach this branch and are not handled. But this is not intentional, I just forgot about them and there are no tests since such things don't exist... I should fix this anyway, thanks for pointing out.

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

PR Review Comment: https://git.openjdk.org/crac/pull/258#discussion_r2259706553


More information about the crac-dev mailing list