[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] sched: Allow the new sched to react to new cons



commit a8c54ce58141d4ffd377ed5d2629fa5e42561f69
Author: Matt Traudt <sirmatt@xxxxxxx>
Date:   Tue Sep 19 19:06:13 2017 -0400

    sched: Allow the new sched to react to new cons
---
 changes/bug23537   | 4 ++++
 src/or/scheduler.c | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/changes/bug23537 b/changes/bug23537
new file mode 100644
index 000000000..93072a3b4
--- /dev/null
+++ b/changes/bug23537
@@ -0,0 +1,4 @@
+  o Minor bugfixes (scheduler):
+    - When switching schedulers due to a consensus change, we didn't give the new
+      scheduler a chance to react to the consensus. Fix that. Fixes bug 23537;
+      bugfix on 0.3.2.1-alpha
diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index ca3cafd9a..64628e4c7 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -371,12 +371,13 @@ void
 scheduler_notify_networkstatus_changed(const networkstatus_t *old_c,
                                        const networkstatus_t *new_c)
 {
+  /* Maybe the consensus param made us change the scheduler. */
+  set_scheduler();
+
   /* Then tell the (possibly new) scheduler that we have a new consensus */
   if (the_scheduler->on_new_consensus) {
     the_scheduler->on_new_consensus(old_c, new_c);
   }
-  /* Maybe the consensus param made us change the scheduler. */
-  set_scheduler();
 }
 
 /*

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits