libp2p / go-libp2p-pubsub

The PubSub implementation for go-libp2p
https://github.com/libp2p/specs/tree/master/pubsub
Other
317 stars 182 forks source link

Improve handling of connection errors and dead peers #433

Open vyzo opened 3 years ago

vyzo commented 3 years ago

Starting with #430 we now short-circuit attempts to reconnect to peers when we fail to open a stream. We still try to do this for dead peers that are still perceive as connected but this logically short-circuits when the stream establishment attempt fails.

This is an improvement over what we previously had, where we could get into "respawning writer" loops. But it does have a drawback: it is possible to have multiple connections to a peer and pick the wrong connection to open a stream, leading to an otherwise healthy peer being ignored.

We need to introduce a principled mechanism for handling reconnect attempts; quite likely a backoff and possibly a blacklist will be enough.