[crac] RFR: Provide arguments for restore [v5]

Dan Heidinga heidinga at openjdk.java.net
Mon Mar 21 16:07:11 UTC 2022


On Thu, 17 Mar 2022 19:20:50 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> This change adds an ability to receive a new set of command-line arguments in the restored Java instance. The supplied demo code shows a faster replacement for `javac`.
>
> Anton Kozlov has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Use System class loader
>  - Make catch() preceise

Ashu raises some good points.  In my view, this PR is really looking at how to "daemonize" a java application such that the first invocation is used to create, initialize, and warmup the daemon process.  This is similar to how Nailgun used to work to keep a "hot" copy of the process in memory and reuse it except here we don't need to keep the process running.  And likely not that different from what some serverless frameworks (OpenWhisk for one) are doing with hot-standbys.  Does this match your vision for where the feature is going?

If so, I think we want to play around with both options - must specify new class vs just the new args - and see which model makes more sense when writing the code.  As the example in the PR shows, users will need to rearchitect to fit this model so we should write some more examples to see which is more natural.

To be explicit - which is better?

Option 1 (current code in this PR)

$ java Foo_Initializer arg1 arg2 arg3   // checkpoint taken
$ java -XX:CRaCRestoreFrom=./cr New_Class arg1 arg2 arg3


Option 2 (original code in this PR with the `Core::new_arguments()` api)

$ java Foo arg1 arg2 arg3   // checkpoint taken
$ java -XX:CRaCRestoreFrom=./cr Foo arg1 arg2 arg3

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

PR: https://git.openjdk.java.net/crac/pull/16


More information about the crac-dev mailing list