-
Notifications
You must be signed in to change notification settings - Fork 949
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): close connections on multistream-select
protocol violations
#3482
Conversation
I am in favor of no longer forwarding errors to a |
Say a remote peer opens a stream, starts a multistream-select negotiation, but aborts half-way through and drops the stream, thus leading to an IO error on the stream on the side of the local node. Do I understand correctly that with this patch the whole connection would be closed? If so, I don't think that is a good behavior as a single failing stream does not imply that the whole connection is useless. |
True, we'd have to still report those back to the handler I guess. |
Closing this because we discovered unintended consequences (see discussion above). |
We are in agreement that the IO error should not close the connection.
We are not in agreement here. I don't think an IO error during protocol negotiation of an inbound stream needs to be reported to the handler. There isn't even a specific handler to deliver the error to, as we don't yet know the protocol as negotiating it failed in the first place. |
Fair, I forgot about that. Let me investigate what that leads to. |
I opened a new PR: #3605 |
Description
As per discussion in #3353, this patch proposes to not report what I deem to be fatal errors during protocol negotiation to a
ConnectionHandler
but instead close the entire connection.The error is returned to the
Swarm
as the reason for why the connection is being closed.Notes
I consider this a medium-risk PR because it introduces a potentially drastic change in behaviour. Previously, a
ConnectionHandler
could simply ignore these errors and a peer that only happened to f.e. send a bad protocol name for one stream but was otherwise well-behaved worked fine. With this patch, such a connection would get closed by theSwarm
.Links to any relevant issues
Open Questions
ProtocolError
and only "close" the connection on IO errors but still report protocol violations back to theConnectionHandler
?Change checklist