Skip to content

Commit a4d6ac7

Browse files
authored
Merge pull request #320 from NodeDB-Lab/fix/issue312-stack-overflow
fix(bootstrap): raise tokio worker stack to 16 MiB
2 parents 4707eb8 + efa0277 commit a4d6ac7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎nodedb/src/main.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@ fn main() -> anyhow::Result<()> {
3131
// worker threads while building its runtime, and the default panic hook
3232
// renders arbitrary panic payloads.
3333
nodedb::bootstrap::panic_hook::install();
34+
// Worker threads carry the whole planning -> dispatch -> execution
35+
// pipeline synchronously; the DDL/index path in particular nests deep
36+
// enough to exhaust tokio's 2 MiB default and die with a silent SIGSEGV.
37+
// 16 MiB gives the same headroom the rest of the process
38+
// already relies on for main-thread work; tokio reserves it virtually
39+
// and commits pages on demand, so idle workers cost nothing.
3440
let runtime = tokio::runtime::Builder::new_multi_thread()
41+
.thread_stack_size(16 * 1024 * 1024)
3542
.enable_all()
3643
.build()?;
3744
if let Err(error) = runtime.block_on(server_main()) {

0 commit comments

Comments
 (0)