Repository navigation
Replies: 2 comments
|
web 和 qqbot 共用 dsh-session-surgeon 默认 dry-run,确认后再 apply(先 dsh plugin --profile web add "github:xiaoshenming/dsh-session-surgeon#main"修好后两个 profile 不要再同时写同一 session。 |
0 replies
|
同簇问题(同 #1497:seq 重叠/回退导致 committed 区拒读)。两条不丢历史的解法(官方未打补丁 0.1.1-rc.2 实测:931,455 事件零 seq gap,
已坏在磁盘上就用 2;想让未来崩溃也看不见就上 1。 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
[Bug] 多进程共用 sessions 根目录时,并发写同一会话会损坏日志(seq gap)
提交位置建议:GitHub Discussions → 💬 General(该仓库未开启 Bug/Feedback 分类,General 为官方兜底分类)。
标题(二选一)
英文: [Bug] Multi-process shared session root: concurrent writes corrupt the JSONL session log (seq gap); history/resume fail
中文: 【Bug】多进程共用 ~/.dsh/sessions 根目录时,两个进程同时写同一会话会损坏日志(seq gap),导致历史加载与 qqbot 启动失败
正文(可直接粘贴)
英文 English
Environment
@deepseek-ai/dsh0.1.0-rc.7, Windowsdsh --profile webanddsh --profile qqbotrun at the same time and share the default~/.dsh/sessionsroot.Steps to reproduce
dsh --profile webanddsh --profile qqbotsimultaneously (both write into~/.dsh/sessions).session.jsonl.zstd, each with its own in-memory seq counter.Actual result
…, 981, 979, 980, …).session.history(web) andagents.resume(qqbot) fail with:corrupt session log: seq gap in committed region at line N (expected X, got Y) (internal)Root cause
dsh-session-persistence-jsonlassumes one writer per session, but there is no cross-process lock or owner marker.session.historyis read-only, but web-side resume/send writes; when two profile processes write the same session it corrupts silently, and the error message gives no hint about concurrent writers.Suggested fixes
中文 Chinese
环境
@deepseek-ai/dsh0.1.0-rc.7,Windowsdsh --profile web和dsh --profile qqbot,两个进程共享默认的~/.dsh/sessions会话根目录。复现步骤
~/.dsh/sessions写入)。session.jsonl.zstd追加事件。实际结果
…, 981, 979, 980, …)。session.history和 qqbot 的agents.resume都会报错:corrupt session log: seq gap in committed region at line N (expected X, got Y) (internal)根因
dsh-session-persistence-jsonl假设"一个会话同一时间只有一个写入者",但没有任何跨进程锁或所有者标记。session.history是只读的,但 web 端的 resume/发送会写入;两个进程同时写同一会话时会静默损坏,且错误信息完全不提示"疑似并发写入"。修复建议
附:损坏日志样例(供官方复现参考)
第 38 行
session/end-seedseq=378;第 39 行agent/inbox/splicedseq=378(重复)→ 校验报 "line 38 (expected 379, got 378)"。双写交错时会出现 seq 顺序错乱(如 981 后又出现 979/980)。临时 workaround:解压 zstd 日志后,从第一个违规行起按物理行序重新编号 seq,再压缩回去即可恢复(事件内容不变)。
All reactions