Always run Telemetry on a blocking thread#7269
Merged
Conversation
timvisee
approved these changes
Sep 19, 2025
Member
There was a problem hiding this comment.
The
&self.actix_telemetry_collector.lock(),
&self.tonic_telemetry_collector.lock(),also peak my interest. Though I haven't seen these causing issues yet.
Member
Author
There was a problem hiding this comment.
Yes, I will definitely look for those in potential future traces.
timvisee
pushed a commit
that referenced
this pull request
Sep 29, 2025
* Always run Telemetry on a blocking thread * run Telemetry on general runtime instead of the blocking Actix one * Polish test
Merged
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The collection telemetry acquires several synchronous locks under the hood.
e.g:
qdrant/lib/collection/src/shards/shard_holder/mod.rs
Line 465 in 4012ea9
qdrant/lib/collection/src/shards/transfer/transfer_tasks_pool.rs
Line 83 in b01b36b
qdrant/lib/collection/src/shards/replica_set/telemetry.rs
Line 31 in a3ce716
qdrant/lib/collection/src/shards/shard_holder/mod.rs
Line 492 in 4012ea9
For context, we did make an effort to encapsulate such usage in dedicated blocking tasks in the past:
But the number of locks is difficult to track and the call sites not necessarily trivial to migrate.
This PR proposes to tackle the issue higher in the stack and run the whole collection telemetry on a dedicated thread.
Hopefully this will be enough to not starve the Actix RT when used in the
telemetryand themetricsendpoints.