Skip to content

Commit 4a88b28

Browse files
h33phawkw
authored andcommitted
fix(subscriber): remove clock skew warning in start_poll (#434)
1 parent 359a4e7 commit 4a88b28

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

console-subscriber/src/stats.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -518,17 +518,8 @@ impl<H: RecordDuration> PollStats<H> {
518518
None => return, // Async operations record polls, but not wakes
519519
};
520520

521-
let elapsed = match at.checked_duration_since(scheduled) {
522-
Some(elapsed) => elapsed,
523-
None => {
524-
eprintln!(
525-
"possible Instant clock skew detected: a poll's start timestamp \
526-
was before the wake time/last poll end timestamp\nwake = {:?}\n start = {:?}",
527-
scheduled, at
528-
);
529-
return;
530-
}
531-
};
521+
// `at < scheduled` is possible when a task switches threads between polls.
522+
let elapsed = at.saturating_duration_since(scheduled);
532523

533524
// if we have a scheduled time histogram, add the timestamp
534525
timestamps.scheduled_histogram.record_duration(elapsed);

0 commit comments

Comments
 (0)