[crac] RFR: 8373687: [CRaC] Add metrics through jcmd [v5]
Radim Vansa
rvansa at openjdk.org
Mon Dec 22 19:27:30 UTC 2025
On Mon, 22 Dec 2025 13:53:26 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:
>> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix MacOSX
>
> src/hotspot/share/runtime/crac.cpp line 726:
>
>> 724: // silently ignoring this
>> 725: return true;
>> 726: }
>
> Not a part of this PR and we should've discussed this earlier, but why don't we fail here? We provide `is_image_score_supported` for Java to check, so we could make `Score.record()` not call this at all in such case. Same for the user-facing code: `Score.setScore` could throw `UnsupportedOperationException` when `Score.isSupported` returns `false`.
I would think that most of the time the score calculation is quite cheap, and in that case the code would always look like
if (Score.isSupported()) {
Score.record(...);
}
One line is better from code clarity, and one native call is better than two (assuming that it is supported when you're already in the CRaC resource that calls this).
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/281#discussion_r2640989970
More information about the crac-dev
mailing list