Avoids potential rounding of -inf time delta in TaskQueuePacedSender.
This rounding triggers a dcheck that crashes debug builds. Furtunately, in release mode this does not matter as the resulting value is anyway capped to 0. Unfortunately, it is almost impossible to write a test for this even with simulated time as the conditions needed to trigger this condition includes thread scheduling being slightly off in such a way that an unscheduled process call preempts a scheduled one at a time when sending a sufficiently large padding packet becomes possible - and right after starting a new probe cluster. We should consider updating this class to make unit testing easier. Bug: webrtc:10809 Change-Id: I533e6e716bddc106d11e82a9e3edb4e0035fd21c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192786 Reviewed-by: Per Kjellander <perkj@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32589}
This commit is contained in:
parent
06bbeb3398
commit
ccbc216ac5
@ -224,9 +224,13 @@ void TaskQueuePacedSender::MaybeProcessPackets(
|
||||
// If we're probing and there isn't already a wakeup scheduled for the next
|
||||
// process time, always post a task and just round sleep time down to
|
||||
// nearest millisecond.
|
||||
time_to_next_process =
|
||||
std::max(TimeDelta::Zero(),
|
||||
(next_process_time - now).RoundDownTo(TimeDelta::Millis(1)));
|
||||
if (next_process_time.IsMinusInfinity()) {
|
||||
time_to_next_process = TimeDelta::Zero();
|
||||
} else {
|
||||
time_to_next_process =
|
||||
std::max(TimeDelta::Zero(),
|
||||
(next_process_time - now).RoundDownTo(TimeDelta::Millis(1)));
|
||||
}
|
||||
} else if (next_process_time_.IsMinusInfinity() ||
|
||||
next_process_time <= next_process_time_ - hold_back_window_) {
|
||||
// Schedule a new task since there is none currently scheduled
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user