[crac] RFR: 8371337: [CRaC] Fastdebug build fails when calling OperatingSystemMxBean.getProcessCpuLoad after restore
Radim Vansa
rvansa at openjdk.org
Fri Nov 14 09:49:56 UTC 2025
On Fri, 14 Nov 2025 08:20:48 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:
>> The whole check is quite indeterministic: if we consider this is called at arbitrary point, the value of `usedKernel` can be just right and the results would not be correct anyway. I think that it's important that at the end the result is sanitized to a safe range 0 - 1.
>> If we consider a more realistic use case, e.g. calling this every 5 seconds, I would expect that before checkpoint the application spent significantly more time before checkpoint than it did until the first hit after restore, so this will detect potentially invalid result.
>> My main motivation was to avoid the crash in debug builds. We could perfect this by adding a hook that will reset the values during C/R but I would opt for a minimalistic change.
>
> To me it looks like we should either check all three `used*` variables (because they are not fully dependent and the checks are cheap) or not check any of them (because checking does not guarantee correctness anyway)
Ok, it won't hurt.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/274#discussion_r2526771510
More information about the crac-dev
mailing list