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

fix: Wrap potentially blocking code in exporter #23

Merged
merged 1 commit into from
Mar 4, 2024
Merged

Conversation

slowli
Copy link
Collaborator

@slowli slowli commented Mar 4, 2024

What ❔

Wraps potentially blocking metrics collection in tokio::task::spawn_blocking.

Why ❔

  • We already have some blocking I/O used in metric collectors (e.g., RocksDB metrics).
  • Some new metrics (e.g., table sizes for Postgres) would use non-blocking I/O, which could be converted into blocking calls using Handle::block_on(). Without this wrapper, they run into the issue of calling it in a non-blocking context.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Documentation comments have been added / updated.
  • Code has been formatted and linted using cargo fmt and cargo clippy.

@slowli slowli requested a review from popzxc as a code owner March 4, 2024 12:37
@slowli slowli merged commit 7a7b013 into main Mar 4, 2024
5 checks passed
@slowli slowli deleted the wrap-blocking-code branch March 4, 2024 12:52
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