Merge branch 'maint-0.3.2' into release-0.3.2

This commit is contained in:
Nick Mathewson 2017-12-04 13:23:52 -05:00
commit 19e01f0cbc
2 changed files with 11 additions and 2 deletions

5
changes/bug23696 Normal file
View File

@ -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.

View File

@ -525,9 +525,13 @@ kist_scheduler_schedule(void)
monotime_get(&now); monotime_get(&now);
/* If time is really monotonic, we can never have now being smaller than the /* 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); 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; diff = 0;
} }
if (diff < sched_run_interval) { if (diff < sched_run_interval) {