mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
0d75344b0e
Fixes a possible root cause of 11553 by only making 64 attempts at most to pick a circuitID. Previously, we would test every possible circuit ID until we found one or ran out. This algorithm succeeds probabilistically. As the comment says: This potentially causes us to give up early if our circuit ID space is nearly full. If we have N circuit IDs in use, then we will reject a new circuit with probability (N / max_range) ^ MAX_CIRCID_ATTEMPTS. This means that in practice, a few percent of our circuit ID capacity will go unused. The alternative here, though, is to do a linear search over the whole circuit ID space every time we extend a circuit, which is not so great either. This makes new vs old clients distinguishable, so we should try to batch it with other patches that do that, like 11438.
16 lines
702 B
Plaintext
16 lines
702 B
Plaintext
o Minor features:
|
|
- When we run out of usable circuit IDs on a channel, log only one
|
|
warning for the whole channel, and include a description of
|
|
how many circuits there were on the channel. Fix for part of ticket
|
|
#11553.
|
|
|
|
|
|
o Major features (performance):
|
|
- Avoid wasting cycles looking for usable circuit IDs. Previously,
|
|
when allocating a new circuit ID, we would in the worst case do a
|
|
linear scan over the entire possible range of circuit IDs before
|
|
deciding that we had exhausted our possibilities. Now, we
|
|
try 64 circuit IDs at random before deciding that we probably
|
|
won't succeed. Fix for a possible root cause of ticket
|
|
#11553.
|