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

[Indexer] Optmize indexer query with timeout and Support Rocksdb metrics #2425

Merged
merged 10 commits into from
Aug 13, 2024

Conversation

baichuan3
Copy link
Collaborator

Summary

Part of #2366 and part of #1717

  1. Supports timeout calls for indexer queries based on tokio timeout, with a default timeout of 60s.
  2. Rocksdb metrics introduces tokio dependency in the Raw store. Resolve the tokio
    runtime execution dependency problem in the test cases and enable rocksdb metrics

Copy link

vercel bot commented Aug 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 1:45pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Aug 13, 2024 1:45pm

Copy link

github-actions bot commented Aug 13, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Comment on lines +118 to +132
tokio::task::block_in_place(|| {
Handle::current().block_on(async move {
timeout(
timeout_duration,
tokio::task::spawn_blocking(move || {
connection
.deref_mut()
.transaction(query)
.map_err(|e| IndexerError::SQLiteReadError(e.to_string()))
}),
)
.await
.map_err(|e| IndexerError::SQLiteAsyncReadError(e.to_string()))??
})
})
Copy link
Contributor

Choose a reason for hiding this comment

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

这一部分代码后面可以通过 ActorContext::spawn 放到一个单独的 actor 去执行,这样就不会 block indexer_reader actor 的线程。不过返回值如何获取需要设计一下。

@baichuan3 baichuan3 merged commit 5b36d2d into main Aug 13, 2024
8 checks passed
@baichuan3 baichuan3 deleted the opt_indexer2 branch August 13, 2024 15:15
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.

[Metrics] Rocksdb Metrics
2 participants