-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Ping protocol closes connection if other party doesn't support /ping
#2109
Comments
I don't know whether this was intentional when first implemented. Either way say a user depends on
Adding this to Out of curiosity, what is your reasoning for not running ping on one of your nodes? |
Typo corrected, thanks!
I think there is a difference between how we implement I am suggesting to not make the handler of
I ran into this when writing the examples of rendezvous. I was trying to build the following setup:
The idea was for |
Mistake on my end. I should have written dead instead of idle connections. There might be situations where users depend on The above is only problematic if another protocol always returns Long story short: I am fine with either way, not closing connections when Ping is unsupported by default or as an option. Only requirement would be for this to be well documented. |
Right, that makes sense. I wonder what a sane default is then. If we end up landing #2110 then we could change the protocol to emit an event instead (i.e. On the other hand, it is less convenient if everyone has to write that line of code themselves. I have to say, I am tempted to emit an event here and not make a decision on what should happen with dead connections. I think that ideal behaviour will depend on the overall usecase of the application and emitting an event allows us to keep the config of |
An additional |
Copy that. To reiterate:
|
Unfortunately we have to compose Ping into the mox until libp2p/rust-libp2p#2109 is fixed. The ping interval is set to a very large value (roughly 100 years), so we don't spam nodes from the rendezvous node, but react to incoming pings. I opted to not print the ping events because they spam the logs.
Sounds good to me @thomaseizinger! Plus a changelog entry please :) |
Unfortunately we have to compose Ping into the mox until libp2p/rust-libp2p#2109 is fixed. The ping interval is set to a very large value (roughly 100 years), so we don't spam nodes from the rendezvous node, but react to incoming pings. I opted to not print the ping events because they spam the logs.
Issue as per title. Is this intentional? I would have expected a more graceful behaviour where the implementation just ignores a particular connection if the other party doesn't support
/ping
. In particular, I am talking aboutProtocolsHandlerUpgrErr::Upgrade(UpgradeError::Select(NegotiationError::Failed))
.If this shouldn't be the default behaviour (IMO it should be), would you accept a PR with a config option that at least makes this configurable? Something like
no_close_on_unsupported
?The text was updated successfully, but these errors were encountered: