Replies: 1 comment
|
官方加载器拒读之后,磁盘上的 https://github.com/xiaoshenming/dsh-session-surgeon 默认 dry-run; git clone https://github.com/xiaoshenming/dsh-session-surgeon.git
cd dsh-session-surgeon
dsh plugin --profile web add link:"$(pwd)"重启 |
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.
Summary
writeSyncedTempFilecreates<logPath>.<hex>.tmpwithopen(tmp,'wx')+ fsync;materializePosixonlyrm(tmp)s afterlink(tmp, finalPath)succeeds (and swallows rm errors). If the process crashes (or power fails) between temp creation and link, the temp file persists forever — there is no startup sweep, andlistSessionDirs/listArtifactsdon't recognize.tmpfiles. These temps contain the complete session content (plaintext or zstd) — disk accumulation plus a session-content leak.Evidence
packages/session/session-persistence-jsonl/src/index.ts:543-568(materializePosix),606-616(writeSyncedTempFile). Both POSIX and Win32 materialize paths share the issue.Trigger
Crash between temp write and link (small window, but every new session materialization passes through it once).
Suggested fix
Sweep
*.tmpfiles in session directories at backend startup (validate owner + random-suffix format before deleting), or replace link semantics with rename-based publish and fsync the directory after cleanup.Verified at master
47f9438.All reactions