Repository navigation
Replies: 2 comments
|
环境信息给得很全(PM2 fork + SIGINT 窗口 + zstd 追加批次),这个复现口径和 #3896/#4274/#4208 是同一家族:双写者 + 过期游标。 PM2 场景的两个立刻能做的缓解:
你日志里「rollbacks(seq 回退)」那段如果能贴一下前后帧的边界(哪一帧开始时间戳跳变),对官方定位双写者窗口会很有价值。 |
0 replies
|
Same family as #1497 — seq overlap/rollback in the committed region. Two zero-history-loss options (verified against the unpatched npm 0.1.1-rc.2: 931,455 events, no seq gap,
Pick #2 if the log is already broken; patch the readers if you want future crashes to stay invisible. |
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.
Environment
@deepseek-ai/dsh, installed globally via npm)dsh webunder PM2 (fork mode,bash -c dsh web, cwd~/.dsh/profiles/web)chatWorkspaces+chatEpochs), log stored assession.jsonl.zstdSummary
When the host process is restarted (e.g.
pm2 restart) while a turn is still being flushed, the old process (mid graceful shutdown / SIGINT) and the new process both append to the samesession.jsonl.zstd. The result is a permanently corrupted session log: sequence numbers interleave from two independent counters, with both gaps and rollbacks. Every subsequent turn then fails with:Steps to reproduce
dsh webunder PM2 with a Lark group chat wired to a persistent workspace session.pm2 restart <app>(SIGINT + immediate respawn).Observed: the turn fails with the corrupt-log error above. Inspecting the decompressed log shows massive seq interleaving/rollback, e.g. consecutive records
seq 58233→seq 50258at the exact line reported by the error, plus hundreds of other gaps.Root cause (as observed)
pm2 restartsends SIGINT and respawns immediately; the old process keeps appending session events during graceful shutdown while the new process has already opened and started appending to the same file.Suggested fixes
flockon the session log (or a sidecar lockfile) before appending; if another live writer holds it, refuse to write (or truncate to the last committed record) instead of interleaving.Workaround (for anyone hitting this)
~/.dsh/sessions/...), bump the channel'schatEpochsvalue so the chat starts a fresh session, and restart. Usepm2 stop→ wait for the PID to disappear →pm2 startinstead ofpm2 restartto avoid the race window.All reactions