From efa027792d81ccde809031224dc72ea30e320257 Mon Sep 17 00:00:00 2001 From: EnRaiha <15997552+EnRaiha@users.noreply.github.com> Date: Wed, 9 Sep 2026 19:23:25 +0800 Subject: [PATCH] fix(bootstrap): raise tokio worker stack to 16 MiB (issue #312) The worker threads carry the whole planning -> dispatch -> execution pipeline synchronously; the DDL/index path nests deep enough to exhaust tokio's 2 MiB default and the process died with a silent SIGSEGV (CREATE VECTOR/SORTED INDEX dropped the connection; inproc tests aborted with 'tokio-rt-worker has overflowed its stack'). 16 MiB restores headroom; tokio reserves the space virtually and commits pages on demand. Verified: index DDL and the previously-aborting suites pass without RUST_MIN_STACK. --- nodedb/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nodedb/src/main.rs b/nodedb/src/main.rs index b7dd17820..eefc2c946 100644 --- a/nodedb/src/main.rs +++ b/nodedb/src/main.rs @@ -31,7 +31,14 @@ fn main() -> anyhow::Result<()> { // worker threads while building its runtime, and the default panic hook // renders arbitrary panic payloads. nodedb::bootstrap::panic_hook::install(); + // Worker threads carry the whole planning -> dispatch -> execution + // pipeline synchronously; the DDL/index path in particular nests deep + // enough to exhaust tokio's 2 MiB default and die with a silent SIGSEGV. + // 16 MiB gives the same headroom the rest of the process + // already relies on for main-thread work; tokio reserves it virtually + // and commits pages on demand, so idle workers cost nothing. let runtime = tokio::runtime::Builder::new_multi_thread() + .thread_stack_size(16 * 1024 * 1024) .enable_all() .build()?; if let Err(error) = runtime.block_on(server_main()) {