Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

inefficiency and dormant panic and permanent message loss in gossip #1704

Closed
rade opened this issue Nov 19, 2015 · 0 comments
Closed

inefficiency and dormant panic and permanent message loss in gossip #1704

rade opened this issue Nov 19, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@rade
Copy link
Member

rade commented Nov 19, 2015

I just found the following in Router.SendAllGossipDown:

        if gossip := channel.gossiper.Gossip(); gossip != nil {
            channel.SendDown(conn, channel.gossiper.Gossip())

which unnecessarily invokes Gossip() twice. Which is inefficient.

And if Gossip() returned nil it can lead to a panic further along (in the GossipSender's GossipData.Merge invocation), or it can cause the GossipSender goroutine to terminate (since it treats nil as a stop), which would cause all subsequent gossip on that particular channel+connection to be discarded.

Fortunately that can't happen since only SurrogateGossiper.Gossip() returns nil, and does so always, hence would not get past the first line of the above code.

@rade rade added the bug label Nov 19, 2015
@rade rade self-assigned this Nov 19, 2015
@rade rade added this to the 1.3.1 milestone Nov 19, 2015
@rade rade closed this as completed in ee12b34 Nov 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant