Multiple smaller correctness issues in the admission::RateLimiter

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Workload Resilience
    • ALL
    • WR Prioritized list
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Several smaller issues were identified during the analysis:

      1. Truncation in doubleToMillis: every nap is rounded down to whole milliseconds, so every queued waiter wakes up to 1ms early, systematically; rounding up would be strictly conservative.
      2. Clock mixing: maturity is computed on the TickSource (monotonic), but the deadline is built on the passed ClockSource (wall clock for opCtx), so wall-clock jumps shift all sleepers together.
      3. Overshoot baked into adjustedNapTime: the nap is computed against nowInSeconds() captured before the borrow, but _timeEnqueued is captured after enqueue and metrics, so every waiter oversleeps by the enqueue-path latency; storing the absolute maturity (debtPaid) in the DeferredToken would be cleaner and race-free.
      4. Metrics: averageTimeQueuedMicros records the original _napTime rather than the actual wait on success, and is not recorded at all on the interrupt path, inconsistent with timeQueuedMicros.

            Assignee:
            Unassigned
            Reporter:
            Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: