[tor-commits] [torflow/master] Be more merciful.
mikeperry at torproject.org
mikeperry at torproject.org
Sat Dec 3 00:36:03 UTC 2011
commit 0e2cb272706083f68ce4b7a8244403580ce37f1b
Author: Mike Perry <mikeperry-git at fscked.org>
Date: Fri Dec 2 16:35:09 2011 -0800
Be more merciful.
We can just check to see if we've previously punished the node by inspecting
the previous values directly. Forgot about that.
---
NetworkScanners/BwAuthority/README.spec.txt | 3 ---
NetworkScanners/BwAuthority/aggregate.py | 6 ++++--
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/NetworkScanners/BwAuthority/README.spec.txt b/NetworkScanners/BwAuthority/README.spec.txt
index 64827cb..bc94eee 100644
--- a/NetworkScanners/BwAuthority/README.spec.txt
+++ b/NetworkScanners/BwAuthority/README.spec.txt
@@ -555,9 +555,6 @@
nodes with already negative pid_error. This prevents us from
punishing relays down to 0 bandwidth.
- Note that this parameter has no effect unless you omit bwauthnsbw=1
- and also set a bwauthti value of non-zero.
-
"bwauthkp=N"
Sets K_p to N/10000.0. If absent, K_p=1.0.
diff --git a/NetworkScanners/BwAuthority/aggregate.py b/NetworkScanners/BwAuthority/aggregate.py
index b3692e8..1dc39ca 100755
--- a/NetworkScanners/BwAuthority/aggregate.py
+++ b/NetworkScanners/BwAuthority/aggregate.py
@@ -582,8 +582,10 @@ def main(argv):
# Don't punish gimpy nodes too hard
if cs_junk.use_mercy:
if not cs_junk.use_desc_bw:
- plog("WARN",
- "Can't be merciful w/ NS feedback! Set bwauthnsbw=0 and bwauthti!=0")
+ # If node was demoted in the past and we plan to demote it again,
+ # let's just not and say we did.
+ if n.desc_bw > n.ns_bw and n.pid_error < 0:
+ n.use_bw = n.desc_bw
if n.pid_error_sum < 0 and n.pid_error < 0:
n.pid_error_sum = 0
More information about the tor-commits
mailing list