[crac] Integrated: PID adjustment on checkpoint
Roman Marchenko
rmarchenko at openjdk.org
Mon Jul 3 17:28:34 UTC 2023
On Tue, 20 Jun 2023 17:45:37 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 is adjusted only if Java's PID is 1 that means Java is run in a container. To adjust PID manually for a checkpoint'ed process, `-XX:CRaCMinPid=<value>` option should be used along with `CRaCCheckpointTo`. Min `CRaCMinPid` value is 1, max `CRaCMinPid` value is `UINT_MAX`, but it is actually limited by OS's pid_max.
>
> There are the following possible scenarios for CRaC running in a container:
>
> // getpid CRaCMinPid | set_last_pid fork
> // ------------------------------------------------
> // 1 - | yes (default) yes
> // 1 1 | no yes
> // 1 >1 | yes yes
> // >1 - | no no
> // >1 <=getpid | no no
> // >1 getpid< | yes yes
This pull request has now been integrated.
Changeset: c48ccf51
Author: Roman Marchenko <rmarchenko at openjdk.org>
Committer: Anton Kozlov <akozlov at openjdk.org>
URL: https://git.openjdk.org/crac/commit/c48ccf5171a91461eaacba34a0f0d7af3a06b3c1
Stats: 332 lines in 6 files changed: 310 ins; 12 del; 10 mod
PID adjustment on checkpoint
Reviewed-by: akozlov
-------------
PR: https://git.openjdk.org/crac/pull/86
More information about the crac-dev
mailing list