-
Notifications
You must be signed in to change notification settings - Fork 11
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
mdns/fix: Failed to register opened substream #301
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
src/protocol/mdns.rs
Outdated
// Before starting the loop, make an initial query to the network | ||
if let Err(error) = self.on_outbound_request().await { | ||
tracing::error!(target: LOG_TARGET, ?error, "Failed to send initial mdns query. MDNS entering failure mode"); | ||
futures::future::pending::<()>().await; |
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.
Basically execution would be stuck here forever, right? Is it a problem that self.socket
will never be polled then below?
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.
Would tokio::time::Interval
work here? It fires immediately the first time, so there will be no need to send the first outbound request manually.
The caveat is to use Delay
MissedTickBehavior
, otherwise we might end up bursting many packets if for some reason other branches of select!
take too long.
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 indeed, have ended up using tokio::time::Interval here 🙏
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
## [0.8.4] - 2024-12-12 This release aims to make the MDNS component more robust by fixing a bug that caused the MDNS service to fail to register opened substreams. Additionally, the release includes several improvements to the `identify` protocol, replacing `FuturesUnordered` with `FuturesStream` for better performance. ### Fixed - mdns/fix: Failed to register opened substream ([#301](#301)) ### Changed - identify: Replace FuturesUnordered with FuturesStream ([#302](#302)) - chore: Update hickory-resolver to version 0.24.2 ([#304](#304)) - ci: Ensure cargo-machete is working with rust version from CI ([#303](#303)) cc @paritytech/networking --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
## [0.8.4] - 2024-12-12 This release aims to make the MDNS component more robust by fixing a bug that caused the MDNS service to fail to register opened substreams. Additionally, the release includes several improvements to the `identify` protocol, replacing `FuturesUnordered` with `FuturesStream` for better performance. ### Fixed - mdns/fix: Failed to register opened substream ([#301](paritytech/litep2p#301)) ### Changed - identify: Replace FuturesUnordered with FuturesStream ([#302](paritytech/litep2p#302)) - chore: Update hickory-resolver to version 0.24.2 ([#304](paritytech/litep2p#304)) - ci: Ensure cargo-machete is working with rust version from CI ([#303](paritytech/litep2p#303)) cc @paritytech/networking --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
## [0.8.4] - 2024-12-12 This release aims to make the MDNS component more robust by fixing a bug that caused the MDNS service to fail to register opened substreams. Additionally, the release includes several improvements to the `identify` protocol, replacing `FuturesUnordered` with `FuturesStream` for better performance. ### Fixed - mdns/fix: Failed to register opened substream ([#301](paritytech/litep2p#301)) ### Changed - identify: Replace FuturesUnordered with FuturesStream ([#302](paritytech/litep2p#302)) - chore: Update hickory-resolver to version 0.24.2 ([#304](paritytech/litep2p#304)) - ci: Ensure cargo-machete is working with rust version from CI ([#303](paritytech/litep2p#303)) cc @paritytech/networking --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This PR ensures that when MDNS encounters an error it does not terminate other litep2p components.
Previously, if MDNS failed to send a query or to handle the incoming packets it would exit.
The exit is presented by the following log line observed on kusama validator:
This situation is causing the substrate Discovery mechanism to also exit, which propagates to the litep2p kademlia handler that exits as well. This leaves the node unable to discover the network or handle incoming substreams.
Testing Done
The issue was reproduced locally with a tokio interval patch that exits the MDNS component after having connectivity in Kusama:
Closes: #300
Thanks @dmitry-markin for also confirming this 🙏
cc @paritytech/networking