tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 70b19894aef65f570840d6ed37e3398e7cb748e6
parent f50d64b62eeb7c07f2e0dd7f23499880d208a434
Author: Nick Mathewson <nickm@torproject.org>
Date:   Mon,  4 Dec 2017 13:23:52 -0500

Merge branch 'maint-0.3.2'

Diffstat:
Achanges/bug23696 | 5+++++
Msrc/or/scheduler_kist.c | 8++++++--
2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/changes/bug23696 b/changes/bug23696 @@ -0,0 +1,5 @@ + o Minor bugfix (KIST scheduler): + - Downgrade a warning to log info when the monotonic time diff is + negative. This can happen on platform not supporting monotonic time. The + scheduler recovers from this without any problem. Fixes ticket 23969; + bugfix on 0.3.2.1-alpha. diff --git a/src/or/scheduler_kist.c b/src/or/scheduler_kist.c @@ -525,9 +525,13 @@ kist_scheduler_schedule(void) monotime_get(&now); /* If time is really monotonic, we can never have now being smaller than the - * last scheduler run. The scheduler_last_run at first is set to 0. */ + * last scheduler run. The scheduler_last_run at first is set to 0. + * Unfortunately, not all platforms guarantee monotonic time so we log at + * info level but don't make it more noisy. */ diff = monotime_diff_msec(&scheduler_last_run, &now); - IF_BUG_ONCE(diff < 0) { + if (diff < 0) { + log_info(LD_SCHED, "Monotonic time between now and last run of scheduler " + "is negative: %" PRId64 ". Setting diff to 0.", diff); diff = 0; } if (diff < sched_run_interval) {