-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(network): introduce relay reservation score #2634
base: rc-2024.12.1-hotfix5
Are you sure you want to change the base?
feat(network): introduce relay reservation score #2634
Conversation
ant-networking/src/relay_manager.rs
Outdated
} | ||
|
||
for from_peer in to_remove { | ||
debug!("Removing {from_peer:?} from the incoming_connections_from_remote_peer"); |
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.
incoming_connections_from_remote_peer
only got pruned when got updated within above block of code
what if entries remained in the container due to some bug/error, which makes it growing infinitely ?
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.
The only scenario where this can happen is from the below code
let Some(latest_time) = connections.iter().map(|(_, _, time, _)| time).max() else {
debug!("The incoming connections from {from_peer:?} are empty. Skipping.");
continue;
};
let Ok(elapsed) = SystemTime::now().duration_since(*latest_time) else {
debug!("Could not obtain elapsed time.");
continue;
};
This can only happen if there is a bug in our code. The cleanup does not depend on the events, it depends on just the MAX_DURATION_TO_TRACK_INCOMING_CONNECTIONS_PER_PEER
.
Just depending on a timer is fine because a connection cannot take more than 15s before a ConnectionEstablished
or a IncomingConnectionError
is emitted tbh.
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.
ok. fine then.
just This can only happen if there is a bug in our code
could happen
4f71cc1
to
f7b3521
Compare
ea86a05
to
a3f5d72
Compare
fa17cbc
to
bc9fad6
Compare
bc9fad6
to
820b92b
Compare
No description provided.