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

Anton Kozlov akozlov at openjdk.org
Fri Jun 30 12:21:23 UTC 2023


On Thu, 29 Jun 2023 17:10:00 GMT, Roman Marchenko <rmarchenko at openjdk.org> wrote:

>> src/java.base/share/native/launcher/main.c line 213:
>> 
>>> 211: static void spin_last_pid(int pid) {
>>> 212:     const int MaxSpinCount = pid < 1000 ? 1000 : pid;
>>> 213:     for (int child = fork(), prev = 0, cnt = MaxSpinCount; child < pid; child = fork(), --cnt) {
>> 
>> Since waitpid is called only if `child < pid`, does this mean the last child that satisfy pid requirement is left unwaited?
>
> Yes, you're correct. 
> Do you think it's potentially dangerous or consumes resources?

Without wait, the child will occupy the PID number forever, without any need for that. So that's wrong. May be we can simplify the loop, so we won't leak the PID?

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

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


More information about the crac-dev mailing list