-
Notifications
You must be signed in to change notification settings - Fork 964
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
feat(swarm): don't have ConnectionHandler
s close connections
#4755
Conversation
This commit purposely does not touch any protocol crates to avoid merge conflicts.
Let me know once this is ready for a review. Direction looking good. |
Needs all linked PRs to merge first before the build is green, otherwise ready for review :) |
@mxinden All dependencies of this PR have been merged so this is ready for review. |
This pull request has merge conflicts. Could you please resolve them @thomaseizinger? 🙏 |
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.
Great to see this final step.
Description
This PR implements the long-awaited design of disallowing
ConnectionHandler
s to close entire connections. Instead, users should close connections viaToSwarm::CloseConnection
from aNetworkBehaviour
or - even better - from theSwarm
viaclose_connection
. ANetworkBehaviour
also does not have a "full" view onto how a connection is used but at least it can correlate whether it created the connection via theConnectionId
. In general, the more modular and friendly approach is to stop "using" a connection if a particular protocol no longer needs it. As a result of the keep-alive algorithm, such a connection is then closed automatically.Depends-on: #4745.
Depends-on: #4718.
Depends-on: #4749.
Related: #3353.
Related: #4714.
Resolves: #3591.
Notes & open questions
Change checklist