[crac] RFR: 8364449: [CRaC] Launch new main outside of the core C/R body [v3]

Timofei Pushkin tpushkin at openjdk.org
Thu Aug 7 08:37:04 UTC 2025


> New main is now launched after restoration completes solving the issues outlined in the JBS task.
> 
> Also the error message when the new main is not found (e.g. the feature is used by accident like in https://github.com/spring-projects/spring-framework/issues/33226) or throws an exception should become less cryptic:
> 
> $ java -XX:CRaCRestoreFrom=cr -jar app.jar
> Exception in thread "main" jdk.crac.RestoreException
>         Suppressed: java.lang.Exception: Failed to execute the new main entry: new initial class = 'app.jar', new main arguments = []. Do not specify these if you just wish to continue the checkpointed execution.
>                 at java.base/jdk.internal.crac.mirror.Core.checkpointRestore(Core.java:314)
>                 at java.base/jdk.internal.crac.mirror.Core.checkpointRestore(Core.java:263)
>                 at jdk.crac/jdk.crac.Core.checkpointRestore(Core.java:73)
>                 at Main.main(Main.java:4)
>         Caused by: java.lang.ClassNotFoundException: app.jar
>                 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
>                 at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
>                 at java.base/java.lang.Class.forName0(Native Method)
>                 at java.base/java.lang.Class.forName(Class.java:547)
>                 at java.base/jdk.internal.crac.mirror.Core.checkpointRestore(Core.java:302)
>                 ... 3 more

Timofei Pushkin has updated the pull request incrementally with three additional commits since the last revision:

 - Move new args parsing into a separate method
 - Test exiting from new main
 - Extend waitForCheckpointed logging

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

Changes:
  - all: https://git.openjdk.org/crac/pull/253/files
  - new: https://git.openjdk.org/crac/pull/253/files/fe256b05..551757c4

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=crac&pr=253&range=02
 - incr: https://webrevs.openjdk.org/?repo=crac&pr=253&range=01-02

  Stats: 88 lines in 4 files changed: 45 ins; 23 del; 20 mod
  Patch: https://git.openjdk.org/crac/pull/253.diff
  Fetch: git fetch https://git.openjdk.org/crac.git pull/253/head:pull/253

PR: https://git.openjdk.org/crac/pull/253


More information about the crac-dev mailing list