[crac] RFR: Support updating MANAGEABLE JVM options during restore

Anton Kozlov akozlov at openjdk.org
Fri Apr 28 15:31:23 UTC 2023


On Fri, 28 Apr 2023 07:24:06 GMT, Radim Vansa <duke at openjdk.org> wrote:

> When a JVM option is MANAGEABLE it can be set at any time during runtime, therefore it is safe to change it during the restore operation. Rather than silently ignoring JVM options passed along with -XX:CRaCRestoreFrom we send them to the restored process and either update or print a warning if given option cannot be changed.

src/hotspot/os/linux/os_linux.cpp line 6557:

> 6555:   ::_restore_start_counter = hdr->_restore_counter;
> 6556: 
> 6557:   for (int i = 0; i < hdr->_nflags; i++) {

This check can be done in the "bootstrap" process (the one that execs to CREngine): just to avoid restoring and finding out the problem. See the other comment about producing the error.

src/hotspot/os/linux/os_linux.cpp line 6579:

> 6577:     }
> 6578:     if (result != JVMFlag::Error::SUCCESS) {
> 6579:       warning("VM Option '%s' cannot be changed, ignoring: %s",

A significant set of options cannot be set on restore at the moment, so it will be even better to highlight they don't have effect and produce an error. It may be useful to revert back to warning (with e.g. an option), but by default it should be disabled (leading to the error)

src/hotspot/share/runtime/globals.hpp line 2096:

> 2094:   /* It does not make sense to change this flag in runtime but we'll tag */ \
> 2095:   /* it MANAGEABLE to prevent warnings when setting this on restore. */     \
> 2096:   product(ccstr, CRaCRestoreFrom, NULL, MANAGEABLE,                         \

This is an example why we want "can be set on restore" (RESTOREBLE?) flag. So MANAGABLE will be implying RESTORABLE, but not every RESTORABLE will be MANAGEABLE.

src/hotspot/share/runtime/globals.hpp line 2106:

> 2104:       "unavailable")                                                        \
> 2105:                                                                             \
> 2106:   product(ccstr, CRaCIgnoredFileDescriptors, NULL, MANAGEABLE,              \

Having this is considered only on init, this also does not fit MANAGEABLE concept (there is no need to change that over management)

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

PR Review Comment: https://git.openjdk.org/crac/pull/61#discussion_r1180515445
PR Review Comment: https://git.openjdk.org/crac/pull/61#discussion_r1180527485
PR Review Comment: https://git.openjdk.org/crac/pull/61#discussion_r1180504943
PR Review Comment: https://git.openjdk.org/crac/pull/61#discussion_r1180533487


More information about the crac-dev mailing list