[crac] RFR: PID adjustment on checkpoint [v3]

Radim Vansa rvansa at openjdk.org
Wed Jun 21 08:23:38 UTC 2023

On Wed, 21 Jun 2023 06:17:39 GMT, Roman Marchenko <rmarchenko at openjdk.org> wrote:

>> On restore, there might be PID value conflicts because of small PID values, if it was checkpoint'ed in a container. Therefore, when checkpointing in a container, we need to move PID value for new processes to a particular value to avoid conflicts on restore.
>> See https://github.com/CRaC/example-lambda/blob/master/checkpoint.cmd.sh#L8 for example.
>> This PR contains implemented functionality similar to the example above, making this work out of the box. By default, if checkpointing, PID value for new processes starts from 128. 
>> To set a custom value, `CRAC_MIN_PID` environment variable should be used. 
>> Min `CRAC_MIN_PID` value is 1, max `CRAC_MIN_PID` is not implemented currently.
> Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision:
>   Disabling the test for non-linux platforms

src/java.base/share/native/launcher/main.c line 191:

> 189:     FILE *last_pid_file = fopen(last_pid_filename, "w");
> 190:     if (!last_pid_file) {
> 191:         perror("last_pid_file fopen");

Should we have this message printed, even if we can achieve it through spinning? Looks like a unnecessary noise when we're still 'fine'.

src/java.base/share/native/launcher/main.c line 326:

> 324:     if (is_checkpoint) {
> 325:         const int crac_min_pid_default = 128;
> 326:         const char *env_min_pid_str = getenv("CRAC_MIN_PID");

Why using an environment variable rather than JVM option? Env vars cannot be 'listed', so the user can't know about them without finding a specific place in documentation.


PR Review Comment: https://git.openjdk.org/crac/pull/86#discussion_r1236594123
PR Review Comment: https://git.openjdk.org/crac/pull/86#discussion_r1236597693

More information about the crac-dev mailing list