[crac] RFR: 8369566: CRaC: Record metrics during checkpoint [v3]

Timofei Pushkin tpushkin at openjdk.org
Thu Oct 23 07:28:57 UTC 2025


On Wed, 22 Oct 2025 11:44:32 GMT, Radim Vansa <rvansa at openjdk.org> wrote:

>> src/java.base/share/native/libcrexec/image_score.cpp line 44:
>> 
>>> 42:   }
>>> 43:   _score.foreach([&](const Score& score){
>>> 44:     fprintf(f, "%s=%f\n", score._name, score._value);
>> 
>> There's no validation that `=` and `\n` are not present in the name so there will probably be problems with parsing
>
> As for `=`, you can easily say that the last `=` is the separator. The `\n` is user shooting himself into foot.
> However in general, this format (and its limitations) is engine-specific and there is no way to report the unsuitability. When the score is reported on Java level, the engine is not consulted yet, and later on we could only fail the checkpoint, which seems excessive to me.
> If you want, I can truncate the metric name at first `\n` when recording it here.

I forgot that the value is not a generic string. With that `=` is indeed not a problem, for `\n` we can truncate with a warning.

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

PR Review Comment: https://git.openjdk.org/crac/pull/269#discussion_r2454179818


More information about the crac-dev mailing list