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

consensus: wait until peerUpdates channel is closed to close remaining #7060

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

williambanfield
Copy link
Contributor

backport from master to v0.35.x

…g peers (#7058)

The race occurred as a result of a goroutine launched by `processPeerUpdate` racing with the `OnStop` method. The `processPeerUpdates` goroutine deletes from the map as `OnStop` is reading from it. This change updates the `OnStop` method to wait for the peer updates channel to be done before closing the peers. It also copies the map contents to a new map so that it will not conflict with the view of the map that the goroutine created in `processPeerUpdate` sees.
@williambanfield williambanfield added the S:automerge Automatically merge PR when requirements pass label Oct 5, 2021
@williambanfield williambanfield merged commit 42ed5d7 into v0.35.x Oct 5, 2021
@williambanfield williambanfield deleted the wb/peer-use-wait-backport branch October 5, 2021 14:49
@williambanfield williambanfield restored the wb/peer-use-wait-backport branch September 9, 2022 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S:automerge Automatically merge PR when requirements pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants