[crac] RFR: 8365241: [CRaC] Ignore new arguments when CRaCIgnoreRestoreIfUnavailable is true [v3]

Anton Kozlov akozlov at openjdk.org
Wed Aug 20 13:00:17 UTC 2025


On Thu, 14 Aug 2025 08:03:14 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:

>> Arguments are not passed to the restored process when `-XX:+CRaCIgnoreRestoreIfUnavailable` is set on restore. The check is performed on the side of the restoring VM since in the restored VM `CRaCIgnoreRestoreIfUnavailable` could have been set before the current restore.
>> 
>> Documentation for the new arguments feature and `CRaCIgnoreRestoreIfUnavailable` is also added, explaining this behavior.
>
> Timofei Pushkin has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Clarify CRaCIgnoreRestoreIfUnavailable guarantees

src/java.base/share/man/java.md line 1093:

> 1091:     arguments. After a successful restoration, the new main method will be invoked
> 1092:     with the specified arguments in the thread that started the checkpoint, on top
> 1093:     of its existing call stack.

I'd suggest start with positive example, something like:

You can pass a new "main" class and arguments with this option. Then, a method matching `main(String[])` will be invoked then with the provided arguments after all `afterRestore` methods complete. The method will invoked on the thread which initiated the checkpoint.

src/java.base/share/man/java.md line 1103:

> 1101:     When restoring with this option, you should specify a main class and its
> 1102:     arguments as usual. If the restoration succeeds, they are ignored, but if it
> 1103:     fails, they are used for the normal startup process.

Let's move the "may fail" note to the bottom. Suggested wording:

If the checkpoint image specified for restoration is identified as being unusable, continue with the normal startup instead of failing. When restoring with this option, you should specify command line arguments for a normal start-up process. If the restoration succeeds, arguments are ignored. Otherwise, they will be used for the JVM initialization. The JVM won't be attempt to start normally, if initial verification passes but restoration does not succeed.

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

PR Review Comment: https://git.openjdk.org/crac/pull/261#discussion_r2288046669
PR Review Comment: https://git.openjdk.org/crac/pull/261#discussion_r2288078346


More information about the crac-dev mailing list