Repository navigation
[PR] fix(launcher): make the spawn health budget configurable (#4947) - #4948
ranxianglei merged 7 commits into
Conversation
…#4947) SPAWN_WAIT_MS (20s) and SLOW_START_GRACE_MS (40s) were compile-time constants. A 1.7 GiB index.db plus two lanes sharing one store cold-starting together pushed pre-bind startup past the fixed 60s budget, and the launcher kill-spawn looped into the same contention (three SIGKILLs, zero-output children, lane down for ~9 minutes until a retry landed in a lock gap). Resolve both knobs through the existing envMillis contract (ranxianglei#1365) so operators can widen the budget without patching dist; defaults are unchanged and invalid values fall back. Documented in CONFIGURATION.md next to the other health-wait knobs. Fixes ranxianglei#4947.
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 —— 与 #4939 / #4609 / #4515 属同一症状家族(大共享库冷启动超过 60s spawn 预算被 SIGKILL),但机制与诉求不同:那几个针对「降低 open 路径自身成本」(#4619 把 quick_check 推迟到 listen 之后、#4539 去掉 pre-listen 的冗余语料解码),本 PR 是让 launcher 的健康等待预算可用 env 调节——属于「成本降下来后仍可能超预算」场景(跨车道写锁竞争、超大库)的逃生阀。两者互补,本 PR 与在途根因修复不重叠。 标签: bug、dsh、scope/wiring、p2(缺陷;dsh 车道复现;launcher 接线层;特定条件下可用但需绕行)。 初审判断:方向正确,代码小而干净(仅把两个常量改为经 |
…g seeds and lifecycle ledger (ranxianglei#4947)
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — 三个红项全部由本 PR 新引入的两个 env 变量( 已直接在 PR 分支修复并推送: 八问
本地已按 CI 同款命令验证三门禁全绿(coverage ok:190 env names 全覆盖;generate+diff 在提交树上干净;ledger OK:170 条在册)。改动文件: |
…is alive, not a mode)
…red state dir The starting marker is one global file per state dir; concurrent launcher activity (other suites, other processes) made this file wait behind it and burn its budget ticks past the assertions (~40% local failure rate). Private XDG roots follow the existing test convention (auto-restart.test.ts); the private port additionally isolates the shared per-port log file (ranxianglei#4811).
(ai: vllm-qwen/qwen3.8-27b) 审核完成,结论:代码可合(等 owner 合并,agent 不代合)。八问逐项: 1. 是什么问题 2. 什么原因导致的 3. 影响范围与严重程度 4. 怎么修复的 5. 是否有回归问题
6. 是否破坏缓存 7. 是否改了设计方向 8. 是否引入新的配置 审核中发现的新问题(已单独立项):多个 launcher-spawn 测试文件并发运行时共享同一个全局 starting-marker 文件,假时钟测试进程可能“等”住外部真实进程一个完整预算,使 #2187 套件的 tick 断言间歇失败(本地三文件并发复现率约 40%,单文件稳定)。该机制 master 上即存在,与本 PR 代码改动无关(PR 只是多了一个并发参与者)。已按机制归并原则单独开 issue:#4953(bug / scope/ci / p3),本 PR 自己的新测试已在 846fc3d 做隔离。 CI:0c6405256 时 11 个 test lane 全绿;我的两个 commit 后 846fc3d 重跑中——文档/守卫类门禁(docs-sync、docs-coverage、config-surface 等)目前全绿,test lane 运行中,出结果后补一行。 判定:方向正确、代码干净、测试有牙(never-healthy 场景同时断言错误文案与预算实际被消费)、未发现回归——可合,请 owner 合并:#4948 |
(ai: vllm-qwen/qwen3.8-27b) Merge-guard re-sync (second pass): master had advanced again after your two new commits ( |
(ai: vllm-qwen/qwen3.8-27b) CI 状态更新:作者又同步了一次 master(新头 |
Windows DSH field feedback: large-index startup budget vs. integrity-check costAdding a real-environment data point after checking the current release and existing work, rather than opening a duplicate PR. Environment and observations
Release / existing-work cross-check
Contribution / validation scope I am not proposing a new PR that defaults integrity checking off, duplicates #4852/#4948, or mixes unrelated DSH plugin compatibility fixes into this launcher change. The useful follow-up is a protected Windows |
(ai: vllm-qwen/qwen3.8-27b) Thanks for the field data points — a useful real-environment anchor for this PR, and your cross-references check out against current source. Confirmations plus one connection worth making explicit: Verified against current master
The connection your numbers actually highlight So the two PRs are complementary in a specific way:
Agree with your scope call: no duplicate PR, no default-off, no unrelated DSH plugin compat mixed in. The right next step is the protected Windows 0.1.209 validation you outlined (checks enabled; record bind/health timing, background-check completion + cache reuse, and the outer host deadline). If that surfaces an independent defect, give it its own minimal reproducer + issue/PR rather than folding it into #4948 (one-issue-one-scope here). Nothing in this comment changes #4948's plan. (For the thread: the #4948 branch is now synced to current master after the second merge-guard pass — clean auto-merge, no conflicts, targeted suites green; CI is the remaining gate.) |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.923-master.27b3155 # this exact build
npm install -g billion-context@master # always the newest merged build
|
(ai: vllm-qwen/qwen3.8-27b) 查重: 非新问题,不开新 issue — 本轮三个 test 分片红与 #4599 在档的 master flake 家族(#5140,修复收敛于 #5144)逐字同签名;按 CI 协调政策 CI 问题统一进 #4599、已有在档条目不另立项。 本轮判定:继承性失败(master 自身红),PR 侧无可修点。当前 head 八问
收工判定:本 PR 侧工作已完成(代码 + 文档 + 台账全部就绪),当前唯一阻塞是继承的 #5140 flake——rerun 已触发等结果;若同签名再现,归哨兵 ci-fixes 收敛或 admin 重跑处置(已在 #4599 留一行结论),PR 侧不再重复排查。 |
Fixes #4947.
What
Resolve
SPAWN_WAIT_MSandSLOW_START_GRACE_MSthrough the existingenvMilliscontract (#1365) asBILI_SPAWN_WAIT_MS/BILI_SLOW_START_GRACE_MS. Defaults unchanged (20s + 40s = 60s total).Why
Reproduction and timings in #4947: a 1.7 GiB shared
index.dbplus two lanes cold-starting together pushed pre-bind startup past the fixed 60s budget; the launcher SIGKILLed the mid-storage-open child three times in a row (attempts 2-3 produced zero output) and the lane stayed down ~9 minutes until a retry landed in a lock gap. #2187 already widened the total once (26-45s Windows starts); this makes the budget tunable without patchingdistfor the cases that exceed it 鈥?large stores (#4939's whole-DBquick_checkcost) and cross-lane write-lock contention.Changes
src/launcher.ts: both knobs viaenvMillis鈥?invalid values fall back to the built-in defaults, same contract as every other ms knobCONFIGURATION.md: both knobs documented in the env table and in the detailed health-wait sectionTests
tests/issue4947-launcher-spawn-budget-env.test.ts(ownnode --testprocess so the module-level constants see the env): knobs resolve at module load (SPAWN_BUDGET_MS === 8000with5000 + 3000), and the resolved budget is actually consumed by the wait loop 鈥?the never-healthy scenario fails withdid not become healthy within 8000msand a tick total far below the Windows/dsh 宿主重启:代理就绪超出 SPAWN_WAIT_MS(20s) 导致 bootstrap 失败,本进程内无重试 → /bili/origin 恒为 null、设置面板永久"未绑定"、整场会话直连(压缩失效) #2187 baseline (>=59ticks for the built-in 60s budget).tests/issue4947-launcher-spawn-budget-env-defaults.test.ts: invalid values (not-a-number,0) fall back to the built-in60000ms.tests/issue2187-launcher-slow-start.test.tspasses unchanged 鈥?all 8 tests green across the three files.