Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/zyre_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,10 +1082,18 @@ zyre_node_recv_peer (zyre_node_t *self)
zyre_peer_t *peer = (zyre_peer_t *) zhash_lookup (self->peers, zuuid_str (uuid));
if (zre_msg_id (msg) == ZRE_MSG_HELLO) {
if (peer) {
// Remove fake peers
// ignore already existing peers
if (zyre_peer_ready (peer)) {
zyre_node_remove_peer (self, peer);
assert (!(zyre_peer_t *) zhash_lookup (self->peers, zuuid_str (uuid)));
/*
NB: we ignore peer here instead of destroying due to possible erroneous
destruction in case of rapid deconnection/reconnection of our node, (e.g.,
when wrongly using zyre_start/zyre_stop), in which case the ZRE_MSG_HELLO
may be received twice from other peers and subsequent peers removal would
provoke a HELLO/GOODBYE storm with the erroneously destroyed peers.
In the case of a peer reconnecting with the same endpoint and the previous
one being non-responsive, ping mechanism will take care of cleaning it.
*/
return;
}
else
if (streq (zyre_peer_endpoint (peer), self->endpoint)) {
Expand Down
Loading