Repository navigation
fix: Tokio worker 栈 2 MiB → 16 MiB,修复长上下文大流式请求下的栈溢出崩溃 - #583
Open
NaIWaniubi wants to merge 1 commit into
Open
NaIWaniubi wants to merge 1 commit into
NaIWaniubi wants to merge 1 commit into
Conversation
生产观测(Windows 10 x64,v3.4.2,2026-11-12 ~ 11-14): - Windows Event ID 1000 三条:0xc00000fd(栈溢出)一次、0xc0000409(fail-fast) 两次且偏移相同(同一代码路径);另有多达 10+ 次/天的进程消失。 - 崩溃 RVA 经 .pdata 解析落在 8337B 的 poll 函数,其引用 ≥15 KiB 的 async Future 状态体 —— 长上下文请求(观测签名:POST /v1/chat/completions stream=true msgs=366 bytes=2.68 MB)的处理链需要比 2 MiB 默认栈更多的 空间。 - 所有请求 handler 经 spawn_task 承载在 Tokio worker(默认 2 MiB 栈)上。 修复:为三处 new_multi_thread() 统一加 thread_stack_size(16 MiB): - server/src/lib.rs global_runtime()(spawn_task 回退运行时) - bin/agent2api-server.rs headless 主运行时 - bin/agent2api-server.rs Windows 服务形态运行时 影响:仅增加线程栈虚拟地址预留(16 MiB/线程,物理页按需提交); worker 数仍为 CPU 核数默认。
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.
问题现象(生产观测)