mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
Merge branch '0.2.4-lognoise-fixes-rebased' into maint-0.2.4
This commit is contained in:
commit
8e05001dc6
11
changes/log-noise
Normal file
11
changes/log-noise
Normal file
@ -0,0 +1,11 @@
|
||||
o Minor bugfixes (log message reduction)
|
||||
- Fix a path state issue that triggered a notice during relay startup.
|
||||
Fixes bug #8320; bugfix on 0.2.4.10-alpha.
|
||||
- Reduce occurrences of warns about circuit purpose in
|
||||
connection_ap_expire_building(). Fixes bug #8477; bugfix on
|
||||
0.2.4.11-alpha.
|
||||
- Fix a directory authority warn caused when we have a large amount
|
||||
of badexit bandwidth. Fixes bug #8419; bugfix on 0.2.2.10-alpha.
|
||||
- Reduce a path bias length check notice log to info. The notice
|
||||
is triggered when creating controller circuits. Fixes bug #8196;
|
||||
bugfix on 0.2.4.8-alpha.
|
@ -803,6 +803,10 @@ circuit_send_next_onion_skin(origin_circuit_t *circ)
|
||||
control_event_bootstrap(BOOTSTRAP_STATUS_REQUESTING_STATUS, 0);
|
||||
}
|
||||
|
||||
pathbias_count_build_success(circ);
|
||||
circuit_rep_hist_note_result(circ);
|
||||
circuit_has_opened(circ); /* do other actions as necessary */
|
||||
|
||||
if (!can_complete_circuit && !circ->build_state->onehop_tunnel) {
|
||||
const or_options_t *options = get_options();
|
||||
can_complete_circuit=1;
|
||||
@ -819,10 +823,6 @@ circuit_send_next_onion_skin(origin_circuit_t *circ)
|
||||
}
|
||||
}
|
||||
|
||||
pathbias_count_build_success(circ);
|
||||
circuit_rep_hist_note_result(circ);
|
||||
circuit_has_opened(circ); /* do other actions as necessary */
|
||||
|
||||
/* We're done with measurement circuits here. Just close them */
|
||||
if (circ->base_.purpose == CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT) {
|
||||
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_FINISHED);
|
||||
@ -1378,7 +1378,7 @@ pathbias_should_count(origin_circuit_t *circ)
|
||||
if (circ->build_state->desired_path_len != 1 ||
|
||||
!circ->build_state->onehop_tunnel) {
|
||||
if ((rate_msg = rate_limit_log(&count_limit, approx_time()))) {
|
||||
log_notice(LD_BUG,
|
||||
log_info(LD_BUG,
|
||||
"One-hop circuit has length %d. Path state is %s. "
|
||||
"Circuit is a %s currently %s.%s",
|
||||
circ->build_state->desired_path_len,
|
||||
|
@ -651,7 +651,9 @@ connection_ap_expire_beginning(void)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (circ->purpose != CIRCUIT_PURPOSE_C_GENERAL) {
|
||||
if (circ->purpose != CIRCUIT_PURPOSE_C_GENERAL &&
|
||||
circ->purpose != CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT &&
|
||||
circ->purpose != CIRCUIT_PURPOSE_PATH_BIAS_TESTING) {
|
||||
log_warn(LD_BUG, "circuit->purpose == CIRCUIT_PURPOSE_C_GENERAL failed. "
|
||||
"The purpose on the circuit was %s; it was in state %s, "
|
||||
"path_state %s.",
|
||||
|
@ -1913,7 +1913,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
|
||||
}
|
||||
|
||||
/* Fix bug 2203: Do not count BadExit nodes as Exits for bw weights */
|
||||
if (consensus_method >= 11) {
|
||||
if (consensus_method >= MIN_METHOD_TO_CUT_BADEXIT_WEIGHT) {
|
||||
is_exit = is_exit && !is_bad_exit;
|
||||
}
|
||||
|
||||
@ -2210,7 +2210,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
|
||||
}
|
||||
// Verify balancing parameters
|
||||
if (consensus_method >= MIN_METHOD_FOR_BW_WEIGHTS && added_weights) {
|
||||
networkstatus_verify_bw_weights(c);
|
||||
networkstatus_verify_bw_weights(c, consensus_method);
|
||||
}
|
||||
networkstatus_vote_free(c);
|
||||
}
|
||||
|
@ -34,6 +34,9 @@
|
||||
/** Lowest consensus method that generates microdescriptors */
|
||||
#define MIN_METHOD_FOR_MICRODESC 8
|
||||
|
||||
/** Lowest consensus method that doesn't count bad exits as exits for weight */
|
||||
#define MIN_METHOD_TO_CUT_BADEXIT_WEIGHT 11
|
||||
|
||||
/** Lowest consensus method that ensures a majority of authorities voted
|
||||
* for a param. */
|
||||
#define MIN_METHOD_FOR_MAJORITY_PARAMS 12
|
||||
|
@ -2257,7 +2257,7 @@ networkstatus_v2_parse_from_string(const char *s)
|
||||
|
||||
/** Verify the bandwidth weights of a network status document */
|
||||
int
|
||||
networkstatus_verify_bw_weights(networkstatus_t *ns)
|
||||
networkstatus_verify_bw_weights(networkstatus_t *ns, int consensus_method)
|
||||
{
|
||||
int64_t weight_scale;
|
||||
int64_t G=0, M=0, E=0, D=0, T=0;
|
||||
@ -2343,14 +2343,21 @@ networkstatus_verify_bw_weights(networkstatus_t *ns)
|
||||
|
||||
// Then, gather G, M, E, D, T to determine case
|
||||
SMARTLIST_FOREACH_BEGIN(ns->routerstatus_list, routerstatus_t *, rs) {
|
||||
int is_exit = 0;
|
||||
if (consensus_method >= MIN_METHOD_TO_CUT_BADEXIT_WEIGHT) {
|
||||
/* Bug #2203: Don't count bad exits as exits for balancing */
|
||||
is_exit = rs->is_exit && !rs->is_bad_exit;
|
||||
} else {
|
||||
is_exit = rs->is_exit;
|
||||
}
|
||||
if (rs->has_bandwidth) {
|
||||
T += rs->bandwidth;
|
||||
if (rs->is_exit && rs->is_possible_guard) {
|
||||
if (is_exit && rs->is_possible_guard) {
|
||||
D += rs->bandwidth;
|
||||
Gtotal += Wgd*rs->bandwidth;
|
||||
Mtotal += Wmd*rs->bandwidth;
|
||||
Etotal += Wed*rs->bandwidth;
|
||||
} else if (rs->is_exit) {
|
||||
} else if (is_exit) {
|
||||
E += rs->bandwidth;
|
||||
Mtotal += Wme*rs->bandwidth;
|
||||
Etotal += Wee*rs->bandwidth;
|
||||
|
@ -54,7 +54,7 @@ void dump_distinct_digest_count(int severity);
|
||||
int compare_routerstatus_entries(const void **_a, const void **_b);
|
||||
int compare_vote_routerstatus_entries(const void **_a, const void **_b);
|
||||
networkstatus_v2_t *networkstatus_v2_parse_from_string(const char *s);
|
||||
int networkstatus_verify_bw_weights(networkstatus_t *ns);
|
||||
int networkstatus_verify_bw_weights(networkstatus_t *ns, int);
|
||||
networkstatus_t *networkstatus_parse_vote_from_string(const char *s,
|
||||
const char **eos_out,
|
||||
networkstatus_type_t ns_type);
|
||||
|
Loading…
Reference in New Issue
Block a user