Skip to content
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

Don't force close connections if ping protocol is not supported by remote #2149

Merged
merged 13 commits into from Jul 30, 2021

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Jul 20, 2021

Fixes #2109.

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of smaller comments and a merge conflict. Otherwise looks good to me.

protocols/ping/CHANGELOG.md Show resolved Hide resolved
protocols/ping/CHANGELOG.md Outdated Show resolved Hide resolved
protocols/ping/src/handler.rs Show resolved Hide resolved
protocols/ping/tests/ping.rs Outdated Show resolved Hide resolved
@@ -189,6 +189,52 @@ fn max_failures() {
QuickCheck::new().tests(10).quickcheck(prop as fn(_,_))
}

#[test]
fn unsupported_doesnt_fail() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@thomaseizinger
Copy link
Contributor Author

Sorry for the failed build. Not yet used to my new RA-based setup.

@mxinden
Copy link
Member

mxinden commented Jul 26, 2021

Still some CI failures which I can not tackle via GitHub suggestions. Can you take another look @thomaseizinger?

@thomaseizinger
Copy link
Contributor Author

@mxinden I had to switch the ProtocolsHandler to initialize with KeepAlive::Yes for the DummyBehaviour. Do we need to mention this in the changelog?

swarm/src/lib.rs Outdated Show resolved Hide resolved
Making this configurable also allows us to delete some code from the
relay tests.
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, also for the cleanup!

}

#[derive(Clone)]
pub struct KeepAliveBehaviour {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @thomaseizinger. Past-me should have done more research before writing this 😇

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a libp2p-test crate is desperately needed :D

@mxinden mxinden merged commit 1e001a2 into libp2p:master Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ping protocol closes connection if other party doesn't support /ping
2 participants