-
Notifications
You must be signed in to change notification settings - Fork 788
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
[Merged by Bors] - Consistent tracking of disconnected peers #2650
Conversation
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
if matches!( | ||
peer_info.connection_status(), | ||
PeerConnectionStatus::Disconnected { .. } | ||
) { | ||
self.disconnected_peers = self.disconnected_peers.saturating_sub(1); | ||
} |
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.
Checking that I understand the logic here correctly:
We're about to change the peer's status from Disconnected -> Disconnecting
, so we decrement the number of disconnected peers. Usually a short time later we will re-increment it when the peer transitions from Disconnecting -> Disconnected
, right?
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.
Yep, see, confuuuuusing.
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.
We shouldn't really be disconnecting, peers that are already disconnected, but it can happen that an old peer in our db tries to connect to us, and we have too many peers, so we dont register it as connected and just move it straight to disconnecting.
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.
Damn, yeah, that's complicated.
bors r+ |
## Issue Addressed N/A ## Proposed Changes When peers switching to a disconnecting state, decrement the disconnected peers counter. This also downgrades some crit logs to errors. I've also added a re-sync point when peers get unbanned the disconnected peer count will match back to the number of disconnected peers if it has gone out of sync previously.
This PR was included in a batch that was canceled, it will be automatically retried |
## Issue Addressed N/A ## Proposed Changes When peers switching to a disconnecting state, decrement the disconnected peers counter. This also downgrades some crit logs to errors. I've also added a re-sync point when peers get unbanned the disconnected peer count will match back to the number of disconnected peers if it has gone out of sync previously.
Pull request successfully merged into unstable. Build succeeded: |
Issue Addressed
N/A
Proposed Changes
When peers switching to a disconnecting state, decrement the disconnected peers counter. This also downgrades some crit logs to errors.
I've also added a re-sync point when peers get unbanned the disconnected peer count will match back to the number of disconnected peers if it has gone out of sync previously.