fix(bootstrap): raise tokio worker stack to 16 MiB - #320
Merged
Conversation
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.
EnRaiha
force-pushed
the
fix/issue312-stack-overflow
branch
from
September 10, 2026 22:13
c0a65ac to
efa0277
Compare
farhan-syah
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Tokio worker threads use a 2 MiB default stack. The DDL → index planning path nests deep enough to overflow it, causing a silent SIGSEGV with no error message. Affected operations:
The process dies mid-planning with `tokio-rt-worker has overflowed its stack` (or silently on the server wire path).
Reproduction
Tested on x86_64 (Intel Core i5-8400, 32 GiB RAM, Debian 13 trixie / Proxmox VE). aarch64 CI runners reproduce with less nesting depth.
Fix
Raise the tokio worker stack from 2 MiB to 16 MiB in `nodedb/src/main.rs`. This matches the main-thread stack the rest of the process already relies on. Tokio reserves the space virtually and commits pages on demand, so idle workers cost nothing.
Verification
Note: `#[tokio::test]` creates an independent runtime per test, so the test suite still requires `RUST_MIN_STACK=33554432` (already set in CI). The fix covers the server binary, which is what runs in production.
Files changed