-
Notifications
You must be signed in to change notification settings - Fork 756
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
beefy: Increment metric and add extra log details #5075
Conversation
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
/// Returns the next peer from the peers cache, if available. | ||
/// | ||
/// If the optional block number if provided, the peers cache is | ||
/// repopulated from the live peers that have voted on higher block numbers. | ||
fn try_next_peer(&mut self, reset_cache: Option<NumberFor<B>>) -> Option<PeerId> { |
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.
This extra Option
on this fn makes the code harder to read and reason about.
Is it making any difference in practice, at least? From what I see, all it achieves is locking once for longer rather than lock, release, lock.
Is this improving the behavior or lowering lock thrashing?
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.
Indeed, don't think the double-lock is having a huge impact on performance :) Just noticed it while digging for some metrics
When we lock release lock, there might be a chance that the peers we have in cache will disconnect in between the locks (and also get propagated to live peers). But I think we have enough info with the metrics and extra logs to catch these.
TLDR; lets keep the code simple :)
This reverts commit 7c77d4e. Signed-off-by: Alexandru Vasile <[email protected]>
This PR increments the beefy metric wrt no peers to query justification from. The metric is incremented when we submit a request to a known peer, however that peer failed to provide a valid response, and there are no further peers to query. While at it, add a few extra details to identify the number of active peers and cached peers, together with the request error Part of: - paritytech#4985 - paritytech#4925 --------- Signed-off-by: Alexandru Vasile <[email protected]>
This PR increments the beefy metric wrt no peers to query justification from.
The metric is incremented when we submit a request to a known peer, however that peer failed to provide a valid response, and there are no further peers to query.
While at it, add a few extra details to identify the number of active peers and cached peers, together with the request error
Part of: