[crac] RFR: Allow users to pass new properties on restore

Anton Kozlov akozlov at openjdk.java.net
Wed May 11 18:31:30 UTC 2022


On Fri, 6 May 2022 15:14:11 GMT, Ashutosh Mehra <duke at openjdk.java.net> wrote:

> Right now the requirement, as I understand, is to provide a way to specify new or update existing application specific properties on restore which can be achieved by just updating the properties in j.l.System.

Seems so, although not something I would call a strict requirement -- something that has emerged as useful and clear.

> I guess as soon as we get access to the args, we can call `os::Linux::restore()` and avoid all the JVM initialization process.

Yeah, `os::Linux::restore(char** args)` for example, with -D and arguments.

At the moment we need a few -XX: arguments parsed, CRaCRestoreFrom, CREngine, and probably more. It was convenient to assume all -XX arguments are parsed and available in os::Linux::restore. But since this won't last forever, let's see how and if to preserve the existing arguments parsing. I would avoid doing big changes, but up to you. 

> It The `args` parameter to `Threads::create_vm()` has all the stuff that we need to pass to `os::Linux::restore()`. We can do a quick pass over `args` to extract the properties and application arguments. The java launcher adds following properties to the `args` in addition to the user specified:
>
> 1. -Djava.class.path
> 2. -Dsun.java.command
> 3. -Dsun.java.launcher
>
> We can ignore 1 and 3, collect the application arguments from 2, filter options in `args` starting with `-D` and pass the set to `os::Linux::restore()`. Is that what you are suggesting?

Apparently yes. Although if possible, it would be better to collect positional arguments directly from the arguments set instead of sun.java.command, so arguments with blank chars will be handled correctly -- this is a problem for now.

Thanks!

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

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


More information about the crac-dev mailing list