]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
sched: Downgrade warning log to info in KIST
authorDavid Goulet <dgoulet@torproject.org>
Mon, 4 Dec 2017 17:22:02 +0000 (12:22 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Mon, 4 Dec 2017 17:22:02 +0000 (12:22 -0500)
Some platforms don't have good monotonic time support so don't warn when the
diff between the last run of the scheduler time and now is negative. The
scheduler recovers properly from this so no need to be noisy.

Fixes #23696

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/bug23696 [new file with mode: 0644]
src/or/scheduler_kist.c

diff --git a/changes/bug23696 b/changes/bug23696
new file mode 100644 (file)
index 0000000..11b38fd
--- /dev/null
@@ -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.
index d1726ba3450a74f01cb78c11205410be838e4154..fea92705d4751407da442faa737c5466da869e8b 100644 (file)
@@ -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) {