[tor-commits] [tor/master] Bug 34088: Remove max timeout calculation and warning.

asn at torproject.org asn at torproject.org
Fri Feb 19 11:21:15 UTC 2021


commit d16b3d12a140af11f313bee3f5c0fbddf6a4e19e
Author: Mike Perry <mikeperry-git at torproject.org>
Date:   Mon Nov 23 21:37:51 2020 -0600

    Bug 34088: Remove max timeout calculation and warning.
    
    With the maximum likelihood estimator for alpha from #40168, we no longer need
    max_time to calculate alpha.
---
 src/core/or/circuitstats.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/src/core/or/circuitstats.c b/src/core/or/circuitstats.c
index 57d45d2240..449c055973 100644
--- a/src/core/or/circuitstats.c
+++ b/src/core/or/circuitstats.c
@@ -1143,7 +1143,6 @@ circuit_build_times_update_alpha(circuit_build_times_t *cbt)
   build_time_t *x=cbt->circuit_build_times;
   double a = 0;
   int n=0,i=0,abandoned_count=0;
-  build_time_t max_time=0;
 
   /* http://en.wikipedia.org/wiki/Pareto_distribution#Parameter_estimation */
   /* We sort of cheat here and make our samples slightly more pareto-like
@@ -1168,8 +1167,6 @@ circuit_build_times_update_alpha(circuit_build_times_t *cbt)
       abandoned_count++;
     } else {
       a += tor_mathlog(x[i]);
-      if (x[i] > max_time)
-        max_time = x[i];
       n++;
     }
   }
@@ -1186,17 +1183,6 @@ circuit_build_times_update_alpha(circuit_build_times_t *cbt)
   }
   tor_assert_nonfatal(n==cbt->total_build_times-abandoned_count);
 
-  if (max_time <= 0) {
-    /* This can happen if Xm is actually the *maximum* value in the set.
-     * It can also happen if we've abandoned every single circuit somehow.
-     * In either case, tell the caller not to compute a new build timeout. */
-    log_warn(LD_BUG,
-             "Could not determine largest build time (%d). "
-             "Xm is %dms and we've abandoned %d out of %d circuits.", max_time,
-             cbt->Xm, abandoned_count, n);
-    return 0;
-  }
-
   /* This is the "Maximum Likelihood Estimator" for parameter alpha of a Pareto
    * Distribution. See:
    * https://en.wikipedia.org/wiki/Pareto_distribution#Estimation_of_parameters





More information about the tor-commits mailing list