Skip to content

Commit

Permalink
Shorten thread names
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedSoliman committed Jun 4, 2024
1 parent 733c6a4 commit 4071006
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/rocksdb/src/db_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ impl RocksDbManager {

// Create our own storage thread pools
let high_pri_pool = rayon::ThreadPoolBuilder::new()
.thread_name(|i| format!("rs:storage-hi-{}", i))
.thread_name(|i| format!("rs:io-hi-{}", i))
.num_threads(opts.storage_high_priority_bg_threads().into())
.build()
.expect("storage high priority thread pool to be created");

let low_pri_pool = rayon::ThreadPoolBuilder::new()
.thread_name(|i| format!("rs:storage-lo-{}", i))
.thread_name(|i| format!("rs:io-lo-{}", i))
.num_threads(opts.storage_low_priority_bg_threads().into())
.build()
.expect("storage low priority thread pool to be created");
Expand Down
9 changes: 6 additions & 3 deletions crates/worker/src/partition_processor_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,12 @@ impl PartitionProcessorManager {
let metadata_store_client = self.metadata_store_client.clone();
let node_id = self.metadata.my_node_id();

let task_name = self.name_cache.entry(partition_id).or_insert_with(|| {
Box::leak(Box::new(format!("partition-processor-{}", partition_id)))
});
// the name is also used as thread names for the corresponding tokio runtimes, let's keep
// it short.
let task_name = self
.name_cache
.entry(partition_id)
.or_insert_with(|| Box::leak(Box::new(format!("pp-{}", partition_id))));

self.task_center.spawn_child(
TaskKind::PartitionProcessor,
Expand Down

0 comments on commit 4071006

Please sign in to comment.