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

analyzer: remove concurrency in runtime analyzer #340

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

Andrew7234
Copy link
Collaborator

One way to resolve #339

This PR removes concurrency from the runtime analyzer. It also refactors the runtime analyzer to fetch all the data initially and then process it sequentially, similar to the consensus analyzer.

Open Question:

  • Should we keep the added mutex in storage.QueryBatch? (see the second commit) During local testing, the additional lock/unlock did not degrade the analyzer speed since the bottleneck is the network requests to the node. Although this mutex is now unnecessary, having a thread-safe QueryBatch would prevent this type of bug from sneaking in (again) though.

storage/api.go Show resolved Hide resolved
storage/api.go Show resolved Hide resolved
storage/api.go Show resolved Hide resolved
Copy link
Contributor

@mitjat mitjat left a comment

Choose a reason for hiding this comment

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

Nice!

storage/api.go Show resolved Hide resolved
analyzer/modules/accounts.go Show resolved Hide resolved
analyzer/runtime/runtime.go Outdated Show resolved Hide resolved
analyzer/runtime/runtime.go Show resolved Hide resolved
storage/api.go Outdated Show resolved Hide resolved
storage/api.go Outdated Show resolved Hide resolved
analyzer: make storage.QueryBatch goroutine-safe

analyzer: lock other storageBatch methods

analyzer: lock other storageBatch

address comments
@Andrew7234 Andrew7234 merged commit 5d6573a into main Mar 9, 2023
@Andrew7234 Andrew7234 deleted the andrew7234/batch-query branch March 9, 2023 19:32
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.

analyzer/runtime: Mutating shared storage.QueryBatch in multiple go-runtines
3 participants