Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ban uses of Instant operations that can panic #1456

Merged
merged 3 commits into from
Feb 1, 2022

Commits on Jan 31, 2022

  1. Ban uses of Instant operations that can panic

    When comparing instances, we should use saturating varieties to help
    ensure that we can't hit panics.
    
    This change bans uses of `std::time::Instant::{duration_since, elapsed,
    sub}` via clippy. Uses are ported to using
    `Instant::saturating_duration_since`.
    
    Related to linkerd/linkerd2#7748
    
    Signed-off-by: Oliver Gould <ver@buoyant.io>
    olix0r committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    9772a89 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2022

  1. fix uses of Instant::sub (#1457)

    * fix uses of `Instant::sub`
    
    It looks like clippy's disallowed methods can't detect the use of
    disallowed *operators*, so #1456 misses a bunch of uses of the `-`
    operator on `Instant`s, mostly in metrics, tap, and the log timestamp
    formatter.
    
    This fixes all of them that I could find.
    
    * fix accidentally changed `Duration` subs
    hawkw committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    d15cee8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f614893 View commit details
    Browse the repository at this point in the history