Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discovery: ensure gossiper syncer has idempotent exit/start, fix deadlock #1325

Merged
merged 3 commits into from
Jun 5, 2018

Conversation

Roasbeef
Copy link
Member

@Roasbeef Roasbeef commented Jun 4, 2018

In this commit, we fix an existing deadlock in the
gossiper->server->peer pipeline by ensuring that we're not holding the
syncer mutex while we attempt to have a syncer filter out the rest of
gossip messages.

@@ -1134,6 +1134,8 @@ func (d *AuthenticatedGossiper) networkHandler() {
for peerPub := range d.peerSyncers {
syncerPeers[peerPub] = struct{}{}
}

peerSyncers := d.peerSyncers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since peerSyncers is accessed w/o a lock below, it seems these values should be copied into a new map, as mutations in the original map will be reflected in peerSyncers

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very true! Might as well just combine it with the above and use that below, will update.

In this commit, we fix an existing deadlock in the
gossiper->server->peer pipeline by ensuring that we're not holding the
syncer mutex while we attempt to have a syncer filter out the rest of
gossip messages.
@Roasbeef Roasbeef merged commit cc12cf4 into lightningnetwork:master Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants