[crac] RFR: 8351701: [CRaC] CRaCEngineOptions=help cannot be used with CRaCRestoreFrom [v2]

Timofei Pushkin tpushkin at openjdk.org
Wed Mar 12 06:38:07 UTC 2025


On Wed, 12 Mar 2025 06:32:36 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:

>> src/hotspot/share/runtime/arguments.cpp line 2264:
>> 
>>> 2262:   postcond(CRaCRestoreFrom != nullptr);
>>> 2263: 
>>> 2264:   if (CRaCEngineOptions && strcmp(CRaCEngineOptions, "help") == 0) {
>> 
>> Since you compare the full value, rather than one option... What will
>> 
>> java -XX:CRaCEngineOptions=help -XXCRaCEngineOptions=foo.bar ...
>> 
>> do, and do we have a test for that?
>
> `help` will be treated as just another engine options and passed through to the engine, which in case of crexec will lead to `crexec: unknown configure option: help` error. Using `-XX:CRaCEngineOptions=help,args=--arg` or `-XX:CRaCEngineOptions=help=true` will do the same. Both on checkpoint and on restore. There were tests for this but I removed most of them as excessive, brought them back now.
> 
> This is intentional, I made it this way for simplicity: would need to parse options and compare all their names to `help` otherwise — and I don't think it would bring much UX benefit. By saying "use '-XX:CRaCEngineOptions=help' to ..." in the VM option docs I meant exactly that: that "help" should be specified as the only option — this can be stated more explicitly but that would be more wordy and I think it is understandable enough as is.

We can replace the above with a separate `-XX:CRaCPrintEngineHelpAndExit` VM option if the behavior above seems too unintuitive

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

PR Review Comment: https://git.openjdk.org/crac/pull/211#discussion_r1990704342


More information about the crac-dev mailing list