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

Add batching to vote_generator #3963

Merged
merged 9 commits into from
Sep 30, 2022

Conversation

pwojcikdev
Copy link
Contributor

There was a very inefficient usage of database write transactions inside vote_generator class where we would create a new write transaction each time we wanted to generate a vote for a block. This led to stalls inside election scheduler and active transaction threads because both of those make a call to election::generate_votes().

To fix this I introduced a new class processing_queue that is a simple queue that can be configured to process batches of items. I then use this queue to process multiple voting requests at once if there is a backlog.

@pwojcikdev pwojcikdev merged commit 8fba6b1 into nanocurrency:develop Sep 30, 2022
@pwojcikdev pwojcikdev deleted the vote-generator-queue branch September 30, 2022 18:55
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.

2 participants