[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #24104 [Core Tor/Tor]: Delay descriptor bandwidth reporting on large relays
#24104: Delay descriptor bandwidth reporting on large relays
-------------------------------------------------+-------------------------
Reporter: teor | Owner: juga
Type: defect | Status:
| needs_revision
Priority: Medium | Milestone: Tor:
| 0.3.5.x-final
Component: Core Tor/Tor | Version: Tor:
| unspecified
Severity: Normal | Resolution:
Keywords: 034-backport-maybe, 033-backport- | Actual Points:
maybe, 032-backport-maybe, 031-backport- |
maybe, 029-backport-maybe, security-low, |
guard-discovery-stats, chutney-wants, bwauth- |
wants, 034-triage-20180328, |
034-removed-20180328, tor-bwauth |
Parent ID: #25925 | Points: 1
Reviewer: ahf | Sponsor:
-------------------------------------------------+-------------------------
Comment (by arma):
Replying to [comment:31 arma]:
> So I resume liking the "proceed if we_are_hibernating()" idea as the
simplest fix.
To be clear (and to save you time), I was thinking something like
{{{
diff --git a/src/or/router.c b/src/or/router.c
index 4afba65..f1a9936 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2440,17 +2440,18 @@ check_descriptor_bandwidth_changed(time_t now)
{
static time_t last_changed = 0;
uint64_t prev, cur;
+ int hibernating = we_are_hibernating();
/* If the relay uptime is bigger than MAX_UPTIME_BANDWIDTH_CHANGE,
* the next regularly scheduled descriptor update (18h) will be enough
*/
- if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE)
+ if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE && !hibernating)
return;
if (!router_get_my_routerinfo())
return;
prev = router_get_my_routerinfo()->bandwidthcapacity;
- cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+ cur = hibernating ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
}}}
And then don't forget to open the ticket for the follow-on (but can be
handled separately) work. :)
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24104#comment:32>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs