Replies: 2 comments
|
会话也是一个插件,文档中交代了会话日志的主旨是仅增加,不许修改。你们为什么会出现格式错误?手动改了第一帧吗 |
0 replies
|
感谢回复!正文 "What we did wrong" 一节其实交代了原因,这里直接认账:
|
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
If any single session file under
$DSH_HOME/sessions/**is in a shape the reader rejects,sessionPersistence.list()throwscorrupt Zstandard session log: …during workspace-registry initialization, and the entire host process enters a crash loop (we observed systemdNRestarts=13, HTTP 000). The Web UI then shows a "fresh" onboarding state — all history appears gone. One bad file in one workspace takes down the service for all workspaces.We hit this twice in one day (2026-08-16/17) while repairing poisoned session records by hand — which leads to the second half of the post: the on-disk frame layout is nowhere documented, so any operator editing a session file will break it.
What we did wrong (so you can see how easily this happens)
A session log (
session.jsonl.zstd) is multi-frame zstd:{"type":"session", …}headerOur repair script re-compressed the file as one frame containing all lines. The reader then rejects it with:
Nothing in the docs (including
docs/persistence-catalog.md) describes this layout. The only way to learn the contract is to read the reader's source (assertZstdHeaderFrameet al.). We learned it the expensive way.The two incidents
--home-jojo-dsh--→sessionPersistence.list()threw at registry init → the web instance (rc.5 checkout under systemd,Restart=always) crash-looped (NRestarts=13, HTTP 000) → the Web UI showed a blank/onboarding state and every session looked "lost". Fixed by re-framing the file (header frame + one record per frame, ~2900 frames, content byte-identical) → service recovered, all history intact.agents.resumethrow for that session only; the channel plugin's error path swallowed it, so inbound messages were dropped without any reply or log. (The swallow itself is reported against the plugin separately.)What we'd like to discuss
list()isolate a corrupt session (skip + log loudly + optionally quarantine the file, e.g. rename to*.corrupt-<ts>) instead of failing the whole registry init? A corrupt session can still be surfaced as a per-session error when someone actually opens it. As-is, one bad file is a total outage of the host, and underRestart=alwaysit's a crash loop with no progress.docs/persistence-catalog.md— plus a short "manually repairing a session file" note (re-frame as header frame + one record per frame; keep content byte-identical) — would save the next operator an hour.dsh doctor-style check that scans all session files and reports corrupt ones (with the specific frame/line) would turn "why is my service crash-looping / this session unreadable?" into a one-liner.Environment
All reactions