Skip to content
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

[network/notifications] Connection to a disabled peer with an expired back-off is backed off again #1826

Open
dmitry-markin opened this issue Oct 9, 2023 · 0 comments
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@dmitry-markin
Copy link
Contributor

dmitry-markin commented Oct 9, 2023

In peerset_report_connect() the disabled peer with a non-expired back-off is handled here:

PeerState::Disabled { connections, backoff_until: Some(ref backoff) }

The next match arm therefore handles the case of the expired back-off:
PeerState::Disabled { mut connections, backoff_until } => {

Nevertheless, it's assumed that backoff_untill can be Some here
let timer_deadline = {
let base = now + Duration::from_secs(5);
if let Some(backoff_until) = backoff_until {
cmp::max(base, backoff_until)
} else {
base
}
};
This is a logic error on it's own, but more importantly the base timer deadline is installed and delays the connection, even though the back-off has already expired once. (It's effectively introduced again.)

Originally discussed in #1563 (comment).

@dmitry-markin dmitry-markin added I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known. labels Oct 9, 2023
@dmitry-markin dmitry-markin moved this to Backlog 🗒 in Networking Oct 9, 2023
@dmitry-markin dmitry-markin changed the title [network/notifications] Connection to a disabled peer with an expired ban is delayed again [network/notifications] Connection to a disabled peer with an expired back-off is delayed again Oct 9, 2023
@dmitry-markin dmitry-markin changed the title [network/notifications] Connection to a disabled peer with an expired back-off is delayed again [network/notifications] Connection to a disabled peer with an expired back-off is backed off again Oct 9, 2023
bkchr pushed a commit that referenced this issue Apr 10, 2024
* reconnect source client

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
Status: Backlog 🗒
Development

No branches or pull requests

1 participant