util: Use steady clock in SeedStrengthen, FindBestImplementation, FlushStateToDisk#27189
Hidden character warning
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
fa29875 to
1111e2f
Compare
|
Concept ACK for moving to monotonic clocks. Am I correct in my understanding that there are no current tests/benchmarks which are calling these while adjusting the system clock, but rather this is additional hardening for a user whose system clock happens to be changed while one of these is executing? I couldn't easily find any callsites which might be directly affected by this, only indirectly. i.e. The system clock happens to change during a call to The only remaining use of |
yes, I don't think the system clock is ever adjusted in tests. Usually, we'd use About the user-facing changes, this should only be an improvement:
|
john-moffett
left a comment
There was a problem hiding this comment.
ACK fa1b4e5
Good conceptual change, as there's no reason for (eg) an NTP adjustment to affect these things.
|
Concept ACK |
…stImplementation, FlushStateToDisk fa1b4e5 Use steady clock in FlushStateToDisk (MarcoFalke) 1111e2f Use steady clock in SeedStrengthen and FindBestImplementation (MarcoFalke) Pull request description: There may be a theoretical deadlock for the duration of the offset when the system clock is adjusted into a past time while executing `SeedStrengthen`. Fix this by using steady clock. Do the same in `FindBestImplementation`, which shouldn't be affected, because it discards outlier measurements. However, doing the same there for consistency seems fine. Do the same in `FlushStateToDisk`, which should make the flushes more steady, if the system clock is adjusted by a large offset. ACKs for top commit: john-moffett: ACK fa1b4e5 willcl-ark: ACK fa1b4e5 Tree-SHA512: cc625e796b186accd53222bd64eb57d0512bc7e588312d254349b542bbc5e5daac348ff2b3b3f7dc5ae0bbbae2ec11fdbf3022cf2164211633765a4b0108e83e
There may be a theoretical deadlock for the duration of the offset when the system clock is adjusted into a past time while executing
SeedStrengthen.Fix this by using steady clock.
Do the same in
FindBestImplementation, which shouldn't be affected, because it discards outlier measurements. However, doing the same there for consistency seems fine.Do the same in
FlushStateToDisk, which should make the flushes more steady, if the system clock is adjusted by a large offset.