Repository navigation
[PR] feat: surface unbounded dump retention at boot and in bili doctor (#3851) - #3869
ranxianglei wants to merge 1 commit into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4579-pr.3869.6d912deThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3869.tgz
npm install -g packageInstall instructions are refreshed on each push. |
) Capture enabled without maxTotalBytes/maxAgeDays grew silently (51.9 GB in 10 days for one user). Add the signposts: one-shot boot WARN naming each dump dir + current size (async, never delays ready), and a 'dump dirs' section in bili doctor with retention state (UNBOUNDED marker / caps / off) and per-dir sizes incl. leftover data. Read-only audit helpers in state-gc.ts share the GC's knob resolution. No new config keys; no write/GC path touched.
9ee999f to
b2b334f
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 是 #3851(dump capture 无保留上限时零可见性)的实现项,无其他在途条目做同一件事。审查中发现本分支 CI 有两个红门(unused-exports / docs-sync),已查重:两者均为 master 既有红(2026-10-19 起),已由 #3870 跟踪、#3871 修复在途(恰好就是这两处),按红风暴防线不在此分支重复修。 标签: dsh, scope/storage, p2(事故客户端为 DSH;改动面是磁盘 dump 目录的诊断可见性;属增强而非缺陷,不打 bug;能用且有绕行=设上限,故 p2)。 独立核验结论(非转述 PR 描述):代码通过,可合入;当前唯一阻塞是 master 既有红门,与本 PR 无关。 验证过程:
八问:
CI 状态与合并判定:
|
|
Stale: 39 cancelled runs / 4 failing checks against current master, and the boot/doctor surface it touches has moved under #3911's runtime-status changes. The underlying p1 (#3851 — unbounded dump capture with no retention warning) stays open; the fix is small to redo cleanly on current master (cap + warn-once at boot + |
What & why
#3851: with
diagnostics.dumpBody/dump4xx(or SSE capture) enabled and neitherdiagnostics.maxTotalBytesnormaxAgeDaysset, the dump directories grow unbounded with zero visibility — one user's system disk went from ~55 GB free to 2.9 GB after 10 days of ordinary DSH use (51.9 GB / 126,712 files). The cap knobs exist (#2412/#2575) but are opt-in, and nothing tells the user their capture is unbounded or how big it has already gotten. This PR adds the missing signposts (issue options 1+2). No new config keys; no behavior change to any existing path.Changes
src/server.ts): when any capture channel is on and both bounds are unset, the server logs a warn at boot naming each active dump dir and its current size, plus how to bound or turn off capture. Size measurement runs async in the background so a huge dir (the reporter had 126k files) never delays ready.bili doctordump section (src/doctor.ts): new "dump dirs" section showing retention state (UNBOUNDEDmarker / configured caps / off) and every dump dir's current size + file count — including leftover data from capture that was since disabled. Additivedumpsfield in--json.src/state-gc.ts):dumpRetentionState(),activeDumpDirs(),measureDumpDir(),fmtBytes(),formatUnboundedDumpWarning()— same knob resolution as the GC itself, so what is reported is exactly what runs.sseDumpDir()accessor insrc/knobs.ts(ACP_DUMP_SSE > top-leveldumpSse).tests/dump-retention-warning.test.ts(row-driven gate matrix with positive+negative rows per Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 discipline, measurement, wording, doctor render variants);tests/doctor.test.tsfixture gains the report field.config surface
None — no keys added/renamed/re-semantics'd. Reuses the existing
diagnostics.maxTotalBytes/maxAgeDays(#2412) and the pre-existing capture toggles.Behavior changes (disclosure)
Additive only:
warnlog line at startup, only when capture is on AND both bounds are unset (previously: silence);bili doctoroutput; additivedumpsfield inbili doctor --json.No GC/write/read path touched; default-off retention semantics unchanged (Diagnostic dumps have no rotation or size cap — 70 GB written in 26 hours #2412 contract intact).
kernel-change: n/a (no kernel/ changes)
Pre-flight (rebased head): typecheck clean; build OK; targeted suites green locally (dump-retention-warning / doctor / state-gc / knobs-config-precedence = 62/62). Full-suite verdict comes from CI.
Closes #3851
CI note (pre-existing master gate reds, owned by #3871)
The
unused-exportsanddocs-syncgates fail on pristine master @ 39fb841 itself (orphanedmaskUrlForPublishexport since a4f2730/#3811; stale duplicate rows left inside the generated param-ref block by a bad merge resolution) — verified locally by running both checks on an unmodified checkout. This PR originally carried an identical one-line export fix as a labeled commit; outbound dedup found #3871 (Closes #3870, the master gate red-storm tracker) already fixing BOTH gates, so this branch now contains only the #3851 feature commit and lets #3871 own the fixes (one red master, one owner). All other lanes pass on this head; once #3871 merges, a rebase turns the remaining two gates green.