Opened 5 weeks ago

Closed 5 weeks ago

#23537 closed defect (fixed)

Allow the new sched to respond to a new conensus, not the old one.

Reported by: pastly Owned by: pastly
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-sched, easy
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

If the sched hears about a new consensus, we should switch schedulers first. Then tell the scheduler implementation about the new consensus. It doesn't make sense to have the old one respond to the new consensus right before we stop using it.

@@ -371,12 +369,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();
 }
 
 /*

Child Tickets

Change History (5)

comment:1 Changed 5 weeks ago by pastly

Status: newmerge_ready

Same patch, but formatted better?

diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index 2d6f7fc4b..32f34329c 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -371,12 +371,12 @@ 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();
 }

 /*

comment:2 Changed 5 weeks ago by nickm

Status: merge_readyneeds_revision

Please make this into a commit, with a changes file, and either tell me a branch to merge or attach the results of formatting the commit with "git format-patch"

(Rationale: the person who wrote the patch should write the commit message.)

comment:3 Changed 5 weeks ago by pastly

Owner: set to pastly
Status: needs_revisionassigned

comment:4 Changed 5 weeks ago by pastly

Status: assignedmerge_ready

bug23537_032_01 on muh gitweb

comment:5 Changed 5 weeks ago by nickm

Resolution: fixed
Status: merge_readyclosed

merged; ty!

Note: See TracTickets for help on using tickets.