[tor-commits] [tor/master] Remove responsibility for flushing log cbs from mainloop

nickm at torproject.org nickm at torproject.org
Thu May 3 15:59:36 UTC 2018


commit 77b7eb2795208ad5c5f66a5626a89b14b03de6f2
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue May 1 10:38:46 2018 -0400

    Remove responsibility for flushing log cbs from mainloop
    
    This is now handled as-needed as the control module is flushing its
    own callbacks.  Closes ticket 25951.
---
 changes/ticket25951 | 9 +++++++++
 src/or/main.c       | 3 ---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/changes/ticket25951 b/changes/ticket25951
new file mode 100644
index 000000000..b6cfc2091
--- /dev/null
+++ b/changes/ticket25951
@@ -0,0 +1,9 @@
+  o Minor features (mainloop):
+    - Move responsibility for
+      flushing log callbacks
+      from a once-per-second callback to a callback that is only scheduled as
+      needed.  Once enough items are removed from our once-per-second
+      callback, we can eliminate it entirely to conserve CPU when idle.
+      Closes ticket
+      25951.
+
diff --git a/src/or/main.c b/src/or/main.c
index f1b830830..e68f72d1e 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1701,9 +1701,6 @@ run_scheduled_events(time_t now)
     signewnym_impl(now);
   }
 
-  /* 0c. If we've deferred log messages for the controller, handle them now */
-  flush_pending_log_callbacks();
-
   /* Maybe enough time elapsed for us to reconsider a circuit. */
   circuit_upgrade_circuits_from_guard_wait();
 





More information about the tor-commits mailing list