[crac] RFR: Correct System.nanotime() value after restore [v3]

Anton Kozlov akozlov at openjdk.org
Thu Apr 13 15:31:49 UTC 2023


On Thu, 13 Apr 2023 15:15:38 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Fixed the problem above; I did a (unpublished) merge with #57 and wrote a test to validate the behaviour. Can contribute it after #57 gets merged (possibly in another PR).
>
> My concern here about this code. This code assumes multiple cycles possible, and does something in not straightforward way. I think we'd better streamline this code (assuming repeated cycles, or not).
> 
> Should not we just record checkpoint millis and nanos unconditionally?

> It estabilishes relation between real time and monotonic time, and it's sufficient to do that just once

I don't belive this is true. Real time can be squezed and extended https://man7.org/linux/man-pages/man3/adjtime.3.html. So it won't be correct to apply a difference in real time to the monotonic clock to calculate the value of monotonic clock in another point of time.

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

PR Review Comment: https://git.openjdk.org/crac/pull/53#discussion_r1165691228


More information about the crac-dev mailing list