Skip to content

Use monotonic time instead of wall time#3268

Open
chenBright wants to merge 1 commit intoapache:masterfrom
chenBright:monotonic_time
Open

Use monotonic time instead of wall time#3268
chenBright wants to merge 1 commit intoapache:masterfrom
chenBright:monotonic_time

Conversation

@chenBright
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: resolve #3258, related to #2763

Problem Summary:

Some internal modules were using wall-clock time for elapsed-time measurement, periodic scheduling, and timeout-related calculations even though they do not depend on real calendar time. This makes them vulnerable to system clock jumps caused by NTP adjustments, manual time changes, or virtualization time drift.

As discussed in #2763 and observed in #3258, clock jumps can lead to incorrect interval calculations, unstable sampling behavior, and unexpected internal state inconsistencies. This PR addresses the issue by switching the affected modules to monotonic time sources where wall-clock semantics are not required.

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects:

  • Breaking backward compatibility:


Check List:

@wwbmmm
Copy link
Copy Markdown
Contributor

wwbmmm commented Apr 12, 2026

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

percentile.h:103] Check failed: _num_samples == _num_added (254 vs. 4294967280)

2 participants