From 1a1ede96de6f882a69fb5cd2a9a0dc52ca22b7ab Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 16 Nov 2022 10:28:25 +0100 Subject: [PATCH] Spawn rayon threads with names --- meilisearch-http/src/option.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index 91608d0d2..a73e4ce19 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -501,8 +501,10 @@ impl TryFrom<&IndexerOpts> for IndexerConfig { type Error = anyhow::Error; fn try_from(other: &IndexerOpts) -> Result { - let thread_pool = - rayon::ThreadPoolBuilder::new().num_threads(*other.max_indexing_threads).build()?; + let thread_pool = rayon::ThreadPoolBuilder::new() + .thread_name(|index| format!("indexing-thread:{index}")) + .num_threads(*other.max_indexing_threads) + .build()?; Ok(Self { log_every_n: Some(other.log_every_n),