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

Parallelize handling events in Orchestrator Watcher #2327

Closed
leszko opened this issue Mar 18, 2022 · 0 comments · Fixed by #2369
Closed

Parallelize handling events in Orchestrator Watcher #2327

leszko opened this issue Mar 18, 2022 · 0 comments · Fixed by #2369

Comments

@leszko
Copy link
Contributor

leszko commented Mar 18, 2022

After each new round is started, for each active orchestrator, we cache its stake in the local DB. This operation is performed sequentially for each orchestrator. In the loop we call cacheOrchestratorStake().

Currently, for 90 active orchestrator, it takes around 3 minutes to execute, but the time will grow linearly together with the number of active orchestrators. Therefore we need to parallelize the cacheOrchestratorStake() execution.

It may be as simple as adding the go keyword and removing the roundMu lock, but it's better to double-check if all operations are thread-safe.

@github-actions github-actions bot added the status: triage this issue has not been evaluated yet label Mar 18, 2022
@leszko leszko added status: core contributors working on it in progress area: blockchain and removed status: triage this issue has not been evaluated yet labels Mar 18, 2022
@yondonfu yondonfu assigned red-0ne and unassigned RiccardoBiosas Apr 19, 2022
@red-0ne red-0ne linked a pull request Apr 29, 2022 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants