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

Ashutosh Mehra duke at openjdk.java.net
Mon May 30 13:43:14 UTC 2022


On Thu, 14 Apr 2022 15:07:22 GMT, Ashutosh Mehra <duke at openjdk.java.net> wrote:

> VM changes: To identify properties that can be modified on restore,
> added a new bool field SystemProperty::_modifiable_on_restore.
> All the jdk related properties are marked unmodifiable. Rest of the
> properties are considered modifiable.
> When the JVM is launched with -XX:CRaCRestoreFrom option, then the
> properties prefixed with "-D" are maintained in a separate list in
> Arguments::_system_properties_for_restore. This list is passed to the JVM
> being restored by writing to a shared memory object.
> When the JVM is restored, it reads the new properties from shared memory
> object and updates its existing list of properties maintained in
> Arguments::_system_properties.
> 
> JDK changes: System::props needs to be updated on restore to account for
> new system properties. For this purpose j.l.System registers a new
> JDKResource which queries new properties from the VM in afterRestore()
> notification and updates System::props. The JDKResource registered by
> j.l.System is given highest priority so it is the first resource to get
> afterRestore() notification.
> 
> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>

This pull request has now been integrated.

Changeset: b2783c90
Author:    Ashutosh Mehra <asmehra at redhat.com>
Committer: Anton Kozlov <akozlov at openjdk.org>
URL:       https://git.openjdk.java.net/crac/commit/b2783c90a8ad81f6a8564e6cacf97a1ea0190ccd
Stats:     330 lines in 6 files changed: 239 ins; 52 del; 39 mod

Allow users to pass new properties on restore

Reviewed-by: akozlov

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

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


More information about the crac-dev mailing list