From 2170f89a93a268588a50a7e754157c1f6e03b15f Mon Sep 17 00:00:00 2001 From: Mike Perry Date: Tue, 23 Apr 2013 14:43:38 -0700 Subject: [PATCH 1/3] Bug 8235: Fix scaling adjustments. We need to subtract both the current built circuits *and* the attempted circuits from the attempt count during scaling, since *both* have already been counted there. --- src/or/circuitbuild.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 31242f6c14..43d2ffe4db 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2491,7 +2491,7 @@ pathbias_scale_close_rates(entry_guard_t *guard) /* Verify that the counts are sane before and after scaling */ int counts_are_sane = (guard->circ_attempts >= guard->circ_successes); - guard->circ_attempts -= opened_attempts; + guard->circ_attempts -= (opened_attempts+opened_built); guard->circ_successes -= opened_built; guard->circ_attempts *= scale_ratio; @@ -2501,7 +2501,7 @@ pathbias_scale_close_rates(entry_guard_t *guard) guard->collapsed_circuits *= scale_ratio; guard->unusable_circuits *= scale_ratio; - guard->circ_attempts += opened_attempts; + guard->circ_attempts += (opened_attempts+opened_built); guard->circ_successes += opened_built; entry_guards_changed(); From c72558f396b35bb42281162198ddbd652f2155fd Mon Sep 17 00:00:00 2001 From: Mike Perry Date: Tue, 23 Apr 2013 14:44:40 -0700 Subject: [PATCH 2/3] Changes file for 8235. --- changes/bug8253-fix | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changes/bug8253-fix diff --git a/changes/bug8253-fix b/changes/bug8253-fix new file mode 100644 index 0000000000..3d36d06c88 --- /dev/null +++ b/changes/bug8253-fix @@ -0,0 +1,6 @@ + o Minor bugfixes (log messages) + - Fix a scaling issue in the path bias accounting code that resulted in + "Bug:" log messages from either pathbias_scale_close_rates() or + pathbias_count_build_success(). This represents a bugfix on a previous + bugfix: The original fix attempted in 0.2.4.10-alpha was incomplete. + Fixes bug 8235; bugfix on 0.2.4.1-alpha. From ac22bf27d73c51ce6da5afbd2ec29a5403eea2d1 Mon Sep 17 00:00:00 2001 From: Mike Perry Date: Tue, 23 Apr 2013 17:53:53 -0700 Subject: [PATCH 3/3] Increase the pathbias state file miscounting version check. We now know the bug is present in 0.2.4.12-alpha too. It should be fixed in 0.2.4.13-alpha, though. --- src/or/entrynodes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index 3234f4f3c7..7a1f67d16a 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -1215,7 +1215,7 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg) int severity = LOG_INFO; /* If this state file was written by a Tor that would have * already fixed it, then the overcounting bug is still there.. */ - if (tor_version_as_new_as(state_version, "0.2.4.12-alpha")) { + if (tor_version_as_new_as(state_version, "0.2.4.13-alpha")) { severity = LOG_NOTICE; } log_fn(severity, LD_BUG, @@ -1280,7 +1280,7 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg) int severity = LOG_INFO; /* If this state file was written by a Tor that would have * already fixed it, then the overcounting bug is still there.. */ - if (tor_version_as_new_as(state_version, "0.2.4.12-alpha")) { + if (tor_version_as_new_as(state_version, "0.2.4.13-alpha")) { severity = LOG_NOTICE; } log_fn(severity, LD_BUG,