Repository navigation
[PR] fix: [instances] warning judges by sessions directory, not lane alone (#5046) - #5075
ranxianglei wants to merge 9 commits into
Conversation
…ry, not lane alone (#5046) The storage-side second-writer guard keys on the sessions directory while the [instances] guard keyed on lane overlap — after isolating a second install via BILI_SESSIONS_DIR, the warn kept claiming 'both processes will write the same sessions directory', a factually wrong false positive that drowns the real signal. Registry markers now carry the resolved sessions dir; when both sides report different dirs the notice drops to info level (unknown dir on either side stays conservative = warn). Both the startup warning and the #2401 slow-tick rescan use the same criterion.
…#5046) Two installs on one machine (e.g. two DSH profiles) default to the same XDG sessions dir + config; with storage.unified on they double-write one index.db (SQLITE_BUSY → failed turns). Document the BILI_SESSIONS_DIR + BILI_CONFIG_FILE isolation recipe in both languages.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7176-pr.5075.16f5e17This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5075.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 关联项: 父 issue #5046(本 PR 即其"不依赖决策部分"的修复);#5015(修 #5014,storage 面板 banner 侧的姊妹改动,不同表面,互补——见下);#4882(增量车道会话级双写标记,机制不同)。无重复在途 PR。 标签: 应为 Review 结论 — 结构化八问本 PR 是我此前处理 #5046 时开出的(fix commit
与 #5015 的关系(合并顺序提示): 两者表面互补——#5015 改 storage 面板 banner 的分类(已知 pid → benign/info),本 PR 改 测试有效性: 新增两个测试双向断言齐备(#3617 纪律): different-dir → info(正例)、same-dir → 原 warn(反例)、legacy marker → 全保守 warn(反例)、marker 落盘 round-trip、rescan 路径同判据。断言有牙,bug 回归时抓得住。 判定: 可合。 CI 绿、定向测试绿、diff 干净(2 个标注清晰的独立 commit,fix/docs 分离)、行为变更已披露。mergeable_state=blocked 来自 branch protection 要求(checks 本身零失败),合并由 owner 操作。 |
…/B degrade policy store.ts second-process detection conflicted between two owner decisions: - #5091 (master): a live foreign pid opening index.db is always informational (SQLite WAL multi-process open is safe on a local disk); no corruption alarm. - #5046/B (this branch): the unified shadow opts into secondWriterPolicy:degrade and refuses to become a persistent second writer when the peer is same-lane or lane-unknown (the risky double-write shape), degrading to legacy-only. Reconciliation: the degrade gate keys on cross-lane safety (a local decision); reporting stays informational for every holder and wire benign stays true (#5091). Aligns the two #5046/B test assertions that still referenced pre-#5091 wording.
|
撤回对 B 的拍板,理由写在 #5046:#5046 (comment) 要点(针对本 PR):提交 3 建议:回退到 另外订正一处:我先前说「本机第二安装已不存在」是错的—— 我没有本仓库 push 权限( |
The new tests/issue5046-second-writer-degrade.test.ts spawns one bare 'node -e' dummy child purely as a live PID holder for its lock-file fixtures — no ports, no servers, so the zone band is irrelevant. The entry is append-only (slot = index drives zone bands) and exists for the SPAWN_RE tripwire, same shape as the #3890/#5114 entries. Without it every test shard dies at pretest before running a single test.
(ai: vllm-qwen/qwen3.8-27b) CI auto-fix lane (attempt 1/2): fixed directly on the branch, new head 41b8697. Details below. What was red, exactlyAll 11 test shards died in ~20s at pretest, before running a single test, with one identical signature on every shard (ubuntu 22/24 + windows 22): Two independent causes stacked:
What I did (2 commits on
|
# Conflicts: # scripts/live-files.mjs
|
(ai: sglang-gpu0/qwen3.8-27b) ① 已同步最新 origin/master( ② 顺手对齐了 shadow 降级日志措辞( ③ 本地验证: ④ 两件留给 owner 的事: |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard 冲突核查结论:无需再推。 分支 head |
(ai: vllm-qwen/qwen3.8-27b) CI auto-fix lane (attempt 2/2): no branch-side fix exists or is needed — this round's red is the inherited #5144 flake. Rerun of the 3 failed jobs triggered; details below. What was redRun 40912373654 on head
All other checks in the run passed; the tripwire/LIVE_FILES registration from attempt 1 held (tests actually ran this time). Why it's inherited, not ours (independent verification, not just citing the thread)
State & actions
结构化八问
判定:无分支侧动作可再推,等 rerun 结果——转绿即可正常 review/merge;若同签名再现,属 #5144 侧待收敛项(#4599 已登记)。 |
|
核实了你这条评论的四项依据,逐条对账。结论仍成立,但两处依据已过期,且 rerun 结果永远等不到了。 一、逐条对账
二、rerun 已被取消,信号为零
我先怀疑是 #5187 的 ci-janitor 干的,查完发现时间对不上,收回这条推测: 取消者我没有查到确证,不猜。客观后果是确定的:「等 rerun 结果」这条路已经走不通了,没有结果会在路上到来。 三、master 已经加强了这条 flake 的诊断,PR 应把它带进来master 在 10-30T03:12:58Z(这条评论发出前 1.5 小时)已有提交: diff: - assert.equal((await h.request("/__bili/plugin/snapshot?conversationId=parent")).status, 200);
+ const coldSnap = await h.request("/__bili/plugin/snapshot?conversationId=parent");
+ assert.equal(coldSnap.status, 200, JSON.stringify(coldSnap.body));位置核验:
这直接否掉你的第 4 条推论「降级为等 rerun」。带着 b5385a7 再跑,flake 重现时日志会直接写出是哪条 四、关于「本地 3×54/54 全绿」这条不能作为「不是本 PR 引起」的证据:CI 并发负载下的时序 flake,本地全绿是预期行为而非反证。真正有力的仍是你的第 2 条(master 自身红)与第 4 条(fleet 同签名先例),这两条我核过,成立。 五、请求的动作
备注: |
|
(ai: vllm-qwen/qwen3.8-27b) Behind 已同步并推送。 origin/master( |
|
[bot] 🏷 状态确认(无新动作):behind 已在上条解决——origin/master |
|
已并入 #5213(随 D 类整合,人工合并入 master)。实例判据按 sessions 目录的修复已在 master 生效。 |
(ai: vllm-qwen/qwen3.8-27b)
Closes #5046 — owner decision (2026-10-29, ruled in #5068): B — a second instance opening the same index.db degrades to legacy-only at open time; S2 threshold stays 3.
Scope (3 labeled commits)
1.
[instances]warning judged by sessions directory, not lane alonesessionsDir, additive optional; registry markers only — proxy-origin discovery file shape unchanged).2. Second-writer degrade (decision B)
UnifiedStore.opengainssecondWriterPolicy: "report" | "degrade"(default"report"). Under"degrade", a live foreign lock holder that is NOT a benign cross-lane share throwsStorageSecondWriterErrorBEFORE lockfile takeover — foreign lock untouched, raw handle closed first (no leaked WAL handle).maybeOpen, incl. the Storage Reliability Trio: open-time self-check (quick_check) + online backup (VACUUM INTO) + second-process probe on the | 存储可靠性三件套:开库自检 quick_check + 在线备份 VACUUM INTO + 同库第二进程探测 #4175 quarantine-retry open) opts in: refusal ⇒ ONE error-level actionable line (namesBILI_SESSIONS_DIR+BILI_CONFIG_FILE+ what is lost: CCR / checkpoints / unified fast-read) +recordSidecarOpenFailure("second-writer: …")⇒ visible on/__bili/status+/__bili/overview(degraded=true, effective=legacy, pre-formatted reason) and the diagnostics blob. Availability preserved: legacy persist keeps compression working.openBackend/export.ts): short-lived writers queue on WAL busy_timeout by design (CLI surface for storage maintenance: bili sessions ls/rm/archive/restore + bili storage gc (re-scoped from #3860) #3928); refusing there breaks the documented CLI contract. All RW open sites audited — proxy sidecar (degrade) and export/CLI (report) are the only two.MAX_CONSECUTIVE_FAILURES = 3) untouched per decision.3. README en+zh: single-machine multi-install isolation section (
BILI_SESSIONS_DIR+BILI_CONFIG_FILErecipe).Behavior change disclosure
[instances]notice warn→info, new wording (kills the false positive from SQLite cache has no graceful degradation when the driver is unavailable: llm/stream throws `Cannot read properties of un | sqlite 缓存在驱动不可用时没有降级:llm/stream 每回合抛 Cannot read properties of undefined (reading 'prepare')(DSH/Electron 打包环境) #5046 field evidence). Same-dir or undeterminable: byte-identical existing warn.secondProcessfield; now the same fact ALSO flips degraded=true / effective=legacy with an actionable reason (before, the install reported healthy unified while double-writing).Verification
UnifiedStore.open⇒ report-only unchanged. Plus storage-durability / storage-engine-proofs / storage-ingest-watermark / instance-governance / launcher = 400 pass / 1 gated-skip / 0 fail.