-
Notifications
You must be signed in to change notification settings - Fork 113
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
1. Fix some address crawler timing issues #3293
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3293 +/- ##
==========================================
- Coverage 77.25% 77.23% -0.03%
==========================================
Files 265 265
Lines 31380 31445 +65
==========================================
+ Hits 24244 24287 +43
- Misses 7136 7158 +22 |
Bumping this up to high priority, because this fixes some occasional CI failures, and it might conflict with other PRs. |
I've tested this PR locally, and the crawler and address book metrics look a lot better. The number of peer addresses rises rapidly, and gets full after a few hours. And Zebra doesn't hang any more, even after a few days. |
efd6bb0
to
fa44edf
Compare
// If the heartbeat is delayed, also delay all future heartbeats. | ||
// (Shorter heartbeat intervals just add load, without any benefit.) | ||
interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Delay); |
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.
👍
Message::Block(block) => format!( | ||
"block {{ height: {}, hash: {} }}", | ||
block | ||
.coinbase_height() | ||
.as_ref() | ||
.map(|h| h.0.to_string()) | ||
.unwrap_or_else(|| "None".into()), | ||
block.hash(), | ||
), |
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.
👍
// Display heights for single-block responses (which Zebra requests and expects) | ||
Response::Blocks(blocks) if blocks.len() == 1 => { | ||
let block = blocks.first().expect("len is 1"); | ||
format!( | ||
"Block {{ height: {}, hash: {} }}", | ||
block | ||
.coinbase_height() | ||
.as_ref() | ||
.map(|h| h.0.to_string()) | ||
.unwrap_or_else(|| "None".into()), | ||
block.hash(), | ||
) | ||
} |
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.
👍
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.
lgtm!
Motivation
Zebra's address crawler is fragile - small changes can cause significant regressions.
This PR deals with a few different sources of that instability.
Solution
Connection
awaiting request state machineReview
This PR is ready for review.
Let's assign a reviewer when people are back from leave.
Reviewer Checklist
I've tested this PR locally, and the crawler and address book metrics look a lot better. The number of peer addresses rises rapidly, and gets full after a few hours. And Zebra doesn't hang any more, even after a few days.
It's hard to test this PR, because the timing issues are subtle, and don't show up in some network environments. We should have better tests after we implement #1592.