-
Notifications
You must be signed in to change notification settings - Fork 58
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
chore(node): [#1999] panic on upnp event GatewayNotFound
#2003
chore(node): [#1999] panic on upnp event GatewayNotFound
#2003
Conversation
e6b0d10
to
a8d1feb
Compare
sn_networking/src/event/swarm.rs
Outdated
@@ -80,6 +80,9 @@ impl SwarmDriver { | |||
} | |||
event_string = "upnp_event"; | |||
info!(?upnp_event, "UPnP event"); | |||
if let libp2p::upnp::Event::GatewayNotFound = upnp_event { | |||
panic!("UPnP is not enabled/supported on your gateway. Please rerun without the `--upnp` flag"); |
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.
This should be an error that we bubble up. In that case we could also later do graceful shutdowns of our swarm. sn_networking
is a library crate, so we don't want consumers to get panics.
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 can bubble the error up, but it would be by one level and still within the sn_networking
lib:
https://github.com/maidsafe/safe_network/blob/main/sn_networking/src/driver.rs#L735-L741
Handling this error gracefully would probably take some refactoring. Not sure if that is worth it. Thoughts?
7e2be6c
to
ad656e1
Compare
ad656e1
to
816ef88
Compare
…upnp-failure chore(node): [#1999] panic on upnp event `GatewayNotFound`
Description
Makes a node panic on the upnp event
GatewayNotFound
. This event only fires when the node runs with the--upnp
flag and libp2p couldn't find the upnp gateway to open ports on.Related Issue
Fixes #1999
Type of Change
Please mark the types of changes made in this pull request.
Checklist
Please ensure all of the following tasks have been completed: