Disabling cbt by consensus doesn't disable exploratory circuit building
View options
- Truncate descriptions
At the bottom of circuit_predict_and_launch_new() we check
/* Finally, check to see if we still need more circuits to learn
* a good build timeout. But if we're close to our max number we
* want, don't do another -- we want to leave a few slots open so
* we can still build circuits preemptively as needed. */
if (num < MAX_UNUSED_OPEN_CIRCUITS-2 &&
get_options()->LearnCircuitBuildTimeout &&
circuit_build_times_needs_circuits_now(&circ_times)) {
flags = CIRCLAUNCH_NEED_CAPACITY;
log_info(LD_CIRC,
"Have %d clean circs need another buildtime test circ.", num);
circuit_launch(CIRCUIT_PURPOSE_C_GENERAL, flags);
return;
}
Here we check get_options()->LearnCircuitBuildTimeout directly, rather than calling circuit_build_times_disabled(). That means we do these exploratory circuits even when cbt is disabled by consensus, or when we're a directory authority, or when we've failed to write cbt history to our state file lately.
We also have the same bug in circuit_expire_old_circuits_clientside() where
if (get_options()->LearnCircuitBuildTimeout &&
circuit_build_times_needs_circuits(&circ_times)) {
/* Circuits should be shorter lived if we need more of them
* for learning a good build timeout */
cutoff.tv_sec -= IDLE_TIMEOUT_WHILE_LEARNING;
} else {
cutoff.tv_sec -= get_options()->CircuitIdleTimeout;
}
- Show labels
- Show closed items