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

mining: Run vote ntfn in a separate goroutine. #1718

Merged
merged 1 commit into from
Apr 7, 2019

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Apr 3, 2019

This ensures the vote handling for the new background miner template happens in a goroutine in order to prevent blocking more transactions being added to the mempool and the vote itself from being immediately relayed to the rest of the network.

It also prevents a potential deadlock that can occur due to the cycle created by being called under the mempool lock and in turn generating a template which itself attempts to grab the mempool lock to get the list of transactions.

This really should be handled better overall, but this serves as a quick solution until the rest of the mining updates are made.

@davecgh davecgh added this to the 1.5.0 milestone Apr 3, 2019
@davecgh davecgh changed the title mining; Run vote ntfn in a separate goroutine. mining: Run vote ntfn in a separate goroutine. Apr 3, 2019
This ensures the vote handling for the new background miner template
happens in a goroutine in order to prevent blocking more transactions
being added to the mempool and the vote itself from being immediately
relayed to the rest of the network.

It also prevents a potential deadlock that can occur due to the cycle
created by being called under the mempool lock and in turn generating a
template which itself attempts to grab the mempool lock to get the list
of transactions.

This really should be handled better overall, but this serves as a quick
solution until the rest of the mining updates are made.
@davecgh davecgh force-pushed the mining_onvotereceived_goroutine branch from e9b474c to b203c8a Compare April 3, 2019 06:52
@davecgh davecgh merged commit b203c8a into decred:master Apr 7, 2019
@davecgh davecgh deleted the mining_onvotereceived_goroutine branch April 7, 2019 03:21
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.

3 participants