-
Notifications
You must be signed in to change notification settings - Fork 187
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
Improve handling of disconnected peers in PubSub #506
Comments
The advantage of the current system is that it is very responsive and it also works at the stream level. Migrating to use the event bus (which appeared in libp2p way after pubsub :) may be worthwhile, but I would suggest that we improve the current peer detection to remove allocation first. |
@vyzo, should we implement this or wait for inputs from other folks:? |
I think we can implement it as it is, it will fix the (minor) dos vecror. |
Ok. Follow up question. Why do we need to read specifically varint or is one byte enough? Should we kill a peer or reset a stream if the unexpected message arrives? |
I think just a byte is enough. |
There is also a backoff mechanism for dealing with dead peers, so we might as well declare the peer dead and enter it. |
Context
Right now, the implementation handles dead peers smartly but uncommonly. PubSub determines a dead peer if the write stream returns
EOF
or other error. This is possible due to the dual-stream model, where peers establish long-lived outbound streams to each other for writes and receive inbound streams for reads.Problems
Notfiee
interface(deprecated) orEvtPeerConnectednessChanged
.Improvement Paths
Other ideas?
The text was updated successfully, but these errors were encountered: