You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
could you explain how this change works?
will on_connection_closed get called when a peer disconnects from a (seed) peer or that's when a peer just unsubscribes from a topic.
if it's only on disconnection, then we still have the memory leak since peers can connect indefinitely. also what if two seed peers are connected to each other? they will never delete the topic, no?
The reason will be displayed to describe this comment to others. Learn more.
also i think we can use the output of self.peer_topics.remove(&peer_id) to speed up the removal operation in topic_peers instead of looping over the complete map (assuming that peer_topics is a peer -> topic map and topic_peers is it's inverse map, haven't loaded this lib locally :))
e16e444
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you explain how this change works?
will
on_connection_closed
get called when a peer disconnects from a (seed) peer or that's when a peer just unsubscribes from a topic.if it's only on disconnection, then we still have the memory leak since peers can connect indefinitely. also what if two seed peers are connected to each other? they will never delete the topic, no?
e16e444
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also i think we can use the output of
self.peer_topics.remove(&peer_id)
to speed up the removal operation intopic_peers
instead of looping over the complete map (assuming that peer_topics is a peer -> topic map and topic_peers is it's inverse map, haven't loaded this lib locally :))