-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the initial peer success count for the fanout limit #2182
Conversation
I've put this PR in draft until #2181 merges to main. |
c1aa7ba
to
344d118
Compare
344d118
to
52850e1
Compare
9838e62
to
7511d05
Compare
52850e1
to
9328a88
Compare
Previously, Zebra was using the total number of seed peers, even if many of those peers had failed. This change also makes sure that the crawler starts after the first successful peer. (Or after all the initial handshake attempts have finished.)
7511d05
to
4c49a2e
Compare
info!("waiting for a successful initial peer connection"); | ||
// it doesn't matter if the sender has been dropped | ||
let _ = initial_success_count_rx.changed().await; | ||
info!(initial_successes = ?*initial_success_count_rx.borrow(), | ||
"asking initial peers for new peers"); | ||
let _ = candidates | ||
.update_initial(initial_peer_count_rx.await.expect("value sent before drop")) | ||
.update_initial(*initial_success_count_rx.borrow()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the initial peer success count for the fanout limit, Part 2
- Wait for the first success count update
- Start the crawler using that success count
// if the receiver has been dropped, we still want to process | ||
// the handshakes | ||
let _ = success_count_tx.send(success_count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the initial peer success count for the fanout limit, Part 1a
- Send the success count whenever we have a success
- This also starts the crawler
Motivation
Zebra is using the total number of seed peers for the fanout limit.
The limit will be too high if any of the initial peer connections fail.
(Typically, lots of those connections fail.)
Solution
The code in this pull request has:
Review
Whoever reviews #2181 should also review this task. (@dconnolly or @jvff)
Related Issues
Part of #2163
Based on PR #2181
Split off PR #2160
Follow Up Work
Rest of #2160