Add a correctness comment to justify the revert

This commit is contained in:
teor 2021-02-15 11:43:49 +10:00
parent a02a00a3f5
commit e85441c914
1 changed files with 6 additions and 0 deletions

View File

@ -194,6 +194,12 @@ where
S::Future: Send + 'static,
{
info!(?initial_peers, "Connecting to initial peer set");
// ## Correctness:
//
// Each `CallAll` can hold one `Buffer` or `Batch` reservation for
// an indefinite period. We can use `CallAllUnordered` without filling
// the underlying `Inbound` buffer, because we immediately drive this
// single `CallAll` to completion, and handshakes have a short timeout.
use tower::util::CallAllUnordered;
let addr_stream = futures::stream::iter(initial_peers.into_iter());
let mut handshakes = CallAllUnordered::new(connector, addr_stream);