[tor-commits] [tor/release-0.4.0] respect accountingmax during soft hibernation

teor at torproject.org teor at torproject.org
Mon Nov 25 02:39:56 UTC 2019


commit a7ccd9a997bc85c0e03926b7d24f7e05a4a51d39
Author: Roger Dingledine <arma at torproject.org>
Date:   Mon Oct 21 04:14:42 2019 -0400

    respect accountingmax during soft hibernation
    
    Relays now respect their AccountingMax bandwidth again. When relays
    entered "soft" hibernation (which typically starts when we've hit
    90% of our AccountingMax), we had stopped checking whether we should
    enter hard hibernation. Soft hibernation refuses new connections and
    new circuits, but the existing circuits can continue, meaning that
    relays could have exceeded their configured AccountingMax.
    
    This commit rolls back some of the cpu-saving fixes, where we tried
    to avoid calling so many of our events while we're off the network.
    
    That's because PERIODIC_EVENT_FLAG_NEED_NET checks net_is_disabled(),
    which returns true even if we're only in soft hibernation.
    
    Fixes bug 32108; bugfix on 0.4.0.1-alpha.
---
 changes/bug32108             | 8 ++++++++
 src/core/mainloop/mainloop.c | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/changes/bug32108 b/changes/bug32108
new file mode 100644
index 000000000..2806fa3e5
--- /dev/null
+++ b/changes/bug32108
@@ -0,0 +1,8 @@
+  o Major bugfixes (relay):
+    - Relays now respect their AccountingMax bandwidth again. When relays
+      entered "soft" hibernation (which typically starts when we've hit
+      90% of our AccountingMax), we had stopped checking whether we should
+      enter hard hibernation. Soft hibernation refuses new connections and
+      new circuits, but the existing circuits can continue, meaning that
+      relays could have exceeded their configured AccountingMax. Fixes
+      bug 32108; bugfix on 0.4.0.1-alpha.
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c
index 18e87fa87..193df61d0 100644
--- a/src/core/mainloop/mainloop.c
+++ b/src/core/mainloop/mainloop.c
@@ -1397,7 +1397,7 @@ STATIC periodic_event_item_t periodic_events[] = {
   /* This is a legacy catch-all callback that runs once per second if
    * we are online and active. */
   CALLBACK(second_elapsed, NET_PARTICIPANT,
-           FL(NEED_NET)|FL(RUN_ON_DISABLE)),
+           FL(RUN_ON_DISABLE)),
 
   /* XXXX Do we have a reason to do this on a callback? Does it do any good at
    * all?  For now, if we're dormant, we can let our listeners decay. */





More information about the tor-commits mailing list