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

Roman Marchenko rmarchenko at openjdk.org
Tue Jun 27 15:13:50 UTC 2023


On Tue, 27 Jun 2023 11:55:18 GMT, Sergey Nazarkin <snazarki at openjdk.org> wrote:

>> Roman Marchenko has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fixing review comments
>>  - Revert "Now CracMinPid option must be set explicitly to adjust PID"
>>    
>>    This reverts commit b3d66800d6ea441fb86498fdbb229400747eb44f.
>
> src/java.base/share/native/launcher/main.c line 122:
> 
>> 120:         const int len = strlen(checkpoint_arg);
>> 121:         if (0 == strncmp(arg, checkpoint_arg, len)) {
>> 122:             crac_min_pid = atoi(arg + len);
> 
> atoi is not recommended to use anymore as it returns 0 on error.
> "It is recommended to instead use the strtol() and        strtoul() family of functions in new programs."

You're right, but in this implementation we don't care about errno. It's enough to get 0 as a parsed wrong value, because CRaCMinPid is introduced as JVM option with the min value =1, so in case of wrong value, JVM prints an error message and stops.

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

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


More information about the crac-dev mailing list