File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1082,10 +1082,18 @@ zyre_node_recv_peer (zyre_node_t *self)
10821082 zyre_peer_t * peer = (zyre_peer_t * ) zhash_lookup (self -> peers , zuuid_str (uuid ));
10831083 if (zre_msg_id (msg ) == ZRE_MSG_HELLO ) {
10841084 if (peer ) {
1085- // Remove fake peers
1085+ // ignore already existing peers
10861086 if (zyre_peer_ready (peer )) {
1087- zyre_node_remove_peer (self , peer );
1088- assert (!(zyre_peer_t * ) zhash_lookup (self -> peers , zuuid_str (uuid )));
1087+ /*
1088+ NB: we ignore peer here instead of destroying due to possible erroneous
1089+ destruction in case of rapid deconnection/reconnection of our node, (e.g.,
1090+ when wrongly using zyre_start/zyre_stop), in which case the ZRE_MSG_HELLO
1091+ may be received twice from other peers and subsequent peers removal would
1092+ provoke a HELLO/GOODBYE storm with the erroneously destroyed peers.
1093+ In the case of a peer reconnecting with the same endpoint and the previous
1094+ one being non-responsive, ping mechanism will take care of cleaning it.
1095+ */
1096+ return ;
10891097 }
10901098 else
10911099 if (streq (zyre_peer_endpoint (peer ), self -> endpoint )) {
You can’t perform that action at this time.
0 commit comments