From 58201516400f1b97830894318e442878a204288e Mon Sep 17 00:00:00 2001 From: David Lutterkort Date: Fri, 12 Sep 2025 12:43:05 -0700 Subject: [PATCH] node: Log the setting of MAX_BLOCKING_THREADS --- node/src/main.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/node/src/main.rs b/node/src/main.rs index e2445ddf587..aa140ac8f4e 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -9,15 +9,17 @@ use graph_node::{launcher, opt}; git_testament!(TESTAMENT); -fn main() { - let max_blocking: usize = std::env::var("GRAPH_MAX_BLOCKING_THREADS") +lazy_static! { + pub static ref MAX_BLOCKING_THREADS: usize = std::env::var("GRAPH_MAX_BLOCKING_THREADS") .ok() .and_then(|v| v.parse().ok()) .unwrap_or(512); +} +fn main() { tokio::runtime::Builder::new_multi_thread() .enable_all() - .max_blocking_threads(max_blocking) + .max_blocking_threads(*MAX_BLOCKING_THREADS) .build() .unwrap() .block_on(async { main_inner().await }) @@ -30,7 +32,10 @@ async fn main_inner() { // Set up logger let logger = logger(opt.debug); - + debug!( + logger, + "Runtime configured with {} max blocking threads", *MAX_BLOCKING_THREADS + ); let ipfs_client = graph::ipfs::new_ipfs_client(&opt.ipfs, &logger) .await .unwrap_or_else(|err| panic!("Failed to create IPFS client: {err:#}"));