Repository navigation
Description
=== billion-context diagnostics ===
generated: 2026-10-31T12:56:03.145Z
bili version: 0.1.209 (commit 39a0ada)
node: v24.18.0
platform: win32 x64
os: Windows_NT 10.0.22631
uptime: 18m 32s
--- storage ---
requested mode: full
effective mode: legacy
degrade reason: index database failed to open (Error: database is locked)
engine: none
engine bootstrap: not-needed
BILI_STORAGE_UNIFIED: (unset)
storage.unified (config file): (unset)
BILI_STORAGE_JSON_WRITER: (unset)
storage.jsonWriter (config file): (unset)
BILI_SQLITE_AUTO_DOWNLOAD: (unset)
storage.sqliteAutoDownload (config file): (unset)
BILI_STORAGE_WAL_JOURNAL_SIZE_LIMIT_BYTES: (unset)
storage.walJournalSizeLimitBytes (config file): (unset)
BILI_ENCRYPTION_KEY set: no
sessions on disk: 5
last [storage] log lines:
2026-10-31T16:35:34.303 [info] [v=0.1.209] [storage] unified FULL mode ENABLED (storage.unified=full or BILI_STORAGE_UNIFIED=full): index.db is the load path (unified-first, legacy fallback); legacy files keep being written — unset the kno…
2026-10-31T17:07:35.870 [error] [v=0.1.209] [storage] another process (pid 30336) is already writing ~.local\share\billion-context\sessions/index.db — two processes on one index.db corrupt it (#3923/#3959). One session dir must have exact…
2026-10-31T17:07:41.001 [info] [v=0.1.209] [storage] unified FULL mode ENABLED (storage.unified=full or BILI_STORAGE_UNIFIED=full): index.db is the load path (unified-first, legacy fallback); legacy files keep being written — unset the kno…
2026-10-31T17:20:48.359 [info] [v=0.1.209] [storage] unified FULL mode ENABLED (storage.unified=full or BILI_STORAGE_UNIFIED=full): index.db is the load path (unified-first, legacy fallback); legacy files keep being written — unset the kno…
2026-10-31T17:38:04.155 [info] [v=0.1.209] [storage] split-brain notice for session session- acknowledged via web UI
2026-10-31T18:11:10.385 [debug] [sess=session-7fea4dca-d936-4fde-88a4-fc8df7cb3377] [v=0.1.209] [storage] periodic WAL checkpoint at ingest 20: busy=0 log=15987 checkpointed=15987
2026-10-31T20:32:45.187 [info] [v=0.1.209] [storage] unified FULL mode ENABLED (storage.unified=full or BILI_STORAGE_UNIFIED=full): index.db is the load path (unified-first, legacy fallback); legacy files keep being written — unset the kno…
2026-10-31T20:37:37.133 [error] [v=0.1.209] [storage] another process (pid 1696) is already writing ~.local\share\billion-context\sessions/index.db — two processes on one index.db corrupt it (#3923/#3959). One session dir must have exactl…
2026-10-31T20:37:37.173 [info] [v=0.1.209] [storage] unified FULL mode ENABLED (storage.unified=full or BILI_STORAGE_UNIFIED=full): index.db is the load path (unified-first, legacy fallback); legacy files keep being written — unset the kno…
2026-10-31T20:52:28.841 [warn] [sess=c9ebbed8-9b0b-4583-b539-0afb1e5d95e1] [v=0.1.209] [storage] unified shadow disabled after 3 consecutive failures (last: Error: database is locked)
2026-10-31T20:52:47.448 [warn] [v=0.1.209] [storage] unified sidecar failed to open ~.local\share\billion-context\sessions/index.db (Error: database is locked) — staying legacy-only; delete the file to reset the index
2026-10-31T20:52:47.594 [info] [v=0.1.209] [storage] second-process pid 1696 has exited — stale warning cleared
--- host client versions ---
dsh profile desktop: dsh ?, dsh-compaction-basic ?, dsh-web-app ?
--- bili config (secrets masked) ---
{"providers":{},"security":{"adminRelay":true}}
Activity
ranxianglei commentedon Oct 31, 2026
(ai: vllm-qwen/qwen3.8-27b)
查重:重复 #5325 —— 同版本 v0.1.209、同平台 win32-x64、同签名(
degrade reason: index database failed to open (Error: database is locked)+another process (pid …) is already writing);#5325 当天先开,owner 已按此机制关闭。按政策我不自行关单,打duplicate标签留说明,关闭由 owner 决定。标签: bug / dsh / scope/storage / p2 / duplicate —— 缺陷类、dsh 车道、存储域;产品仍可用有绕行故 p2;与 #5325 同症状同机制。
发生了什么(人话):你的机器上先后有三个 bili 进程共用同一个 sessions 目录(
~\.local\share\billion-context\sessions\)。日志时间线:pid 1696 于 20:32 正常启动;20:37 第二个进程启动时检出 1696(那条 error 行,v0.1.209 只是告警、继续跑,之后它的写入连续撞锁);约 20:52 第三个进程(出这份诊断的)打开 index.db 时锁还没释放,SQLite 直接回database is locked→ 静默落回 legacy-only。v0.1.209 里「两个进程共写一个 index.db」是 warn-only 共存设计,锁竞争失败后没有任何重试或恢复路径——这正是 #5325 报过的已知形态。数据是完好的:full 模式下 JSON 文件一直在写,index.db 是被「锁住」不是「损坏」。不要删任何文件(删了反而丢 checkpoints)。
master 上的行为(已修好,尚未发版):
最新 release 仍是 v0.1.209,以上变更随下一版本发出。
当前版本的即时恢复:
BILI_SESSIONS_DIR给每个实例独立目录隔离;BILI_STORAGE_UNIFIED=legacy接受 JSON-only(这是用户选择,不再是隐式兜底)。结构化八问
BILI_STORAGE_UNIFIED=legacy语义不变。收工判定:本单为 #5325 的重复条目,全部观测到的机制均已被 master 修复链覆盖,等下一版发布即可根治;已打 duplicate 标签,关闭留给 owner。
ranxianglei commentedon Oct 31, 2026
ework 问个问题 这个问题在master还会存在吗?master应该禁止回退到legacy-only了
ranxianglei commentedon Oct 31, 2026
(ai: vllm-qwen/qwen3.8-27b)
不会。master 上这个形态(锁竞争 → 静默永久 legacy-only)已经不存在,你的理解是对的,代码核实如下:
1. 触发条件本身不再是错误。两个进程共用一个 index.db 现在是受支持拓扑(#5064 最终裁决 / PR #5294)——WAL 多进程安全,第二写者只走 informational 提示 + status 面(
src/storage/store.ts里 StorageSecondWriterError 已标 deprecated、仓内不再抛出)。v0.1.209 那套「检出他进程 → 告警但继续 → 撞锁降级」的链条整个没了。2. 万一 open 时仍撞上环境类失败(含极端争用下的
database is locked)→ 拒绝启动,不降级(src/storage/shadow.ts:301-316):no-engine / CANTOPEN / readonly / OS 级拒绝一律 throw,报错里带修复指引(win32 还有杀软/完整性标签/路径超长定向提示),或显式设BILI_STORAGE_UNIFIED=legacy才是用户选择。#5361 诊断里那种「effective mode: legacy + degrade reason」的静默终态在 master 上开不出来。3. 运行期不再有任何永久熔断。3 连败自禁用已整体移除(
shadow.ts:121-124,字段保留兼容、恒 false),ingest 失败逐次告警 + 永远重试,不存在「撞几次就终身 legacy」的棘轮。唯一保留的两条「无索引服务」路径,都不是静默降级:
shadow.ts:258-285)——这是 2026-10-30 你拍板的最终形态(撤掉了 [PR] fix: auto-quarantine a corrupt index.db instead of degrading to legacy-only forever #3965 的自动隔离改名);BILI_STORAGE_UNIFIED=legacy/ 加密 opt-out / persistence off):用户配置,不算降级。所以结论:#5361 报的具体问题在 master 上双重消失——触发机制升为支持拓扑 + 残余环境故障改 fail-fast。等下一版发出即可根治用户侧。