Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
atropos: Use Instant instead of SystemTime
Atropos currently uses the std::time::SystemTime object to time when load balance steps, etc should occur. As described in [0], SystemTime::duration_since() can throw an error if the @earlier field is in fact later than self. This can occur randomly even with correct code, as according to the docs: > This function may fail because measurements taken earlier are not > guaranteed to always be before later measurements (due to anomalies > such as the system clock being adjusted either forwards or backwards). [0]: https://doc.rust-lang.org/std/time/struct.SystemTime.html#method.duration_since The solution is to instead use std::time::Instant, which is monotonic as described in [1]. [1]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.duration_since Without this patch, atropos will error out after ~1 minute of running rcutorture. With the patch, it is able to run (seemingly) indefinitely. Signed-off-by: David Vernet <void@manifault.com>
- Loading branch information