-
Notifications
You must be signed in to change notification settings - Fork 23
improve efficiency of propagating address failures #443
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
base: master
Are you sure you want to change the base?
Conversation
src/transport/manager/mod.rs
Outdated
| let adresses = context.dial_failure_addresses(&[address.clone()]); | ||
|
|
||
| match context.tx.try_send(make_dial_failure_event(peer, adresses.clone())) { |
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.
nit: Is there a way to avoid the cloning here? Maybe changing the signature of the fn to take a & Multiaddr?
I would also inline the make_dial_failure_event:
match context.tx.try_send(InnerTransportEvent::DialFailure { peer, addresses })Instead of cloning the addreses here (addresses.clone()), we could recreate the addresses on error
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.
i have changed to this inline way, but can't still do without cloning
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.
Looks good to me! Thanks again for contributing 🙏
| peer, | ||
| addresses: vec![address.clone()], | ||
| }) | ||
| .send(InnerTransportEvent::DialFailure { peer, addresses }) |
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.
@dharjeezy Can you also add to the doc of InnerTransportEvent & TransportEvent that addresses is only forwarded if the protocol was registered with DialFailureAddresses::Required, please?
closes #409