You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
@deepseek-ai/dsh-atomic-write:锁文件在进程异常退出后不会被释放@deepseek-ai/dsh-atomic-write@0.1.7-rc.1,packages/util/atomic-write。withFileLock()把 PID 写进<file>.lock,但从来不读它。持锁进程被 kill -9 或崩溃、没走成finally,锁文件就永久留下了。之后每个写入方都要等满
waitMs才失败。dsh plugin那边是 120 秒(@deepseek-ai/dsh-plugin-manager的lockWaitMs,默认12e4),所以现象就是"卡住不动,两分钟后报错"。跟 dsh web 开不开无关,重启也没用,只能手动删文件。代码证据(
lib/index.js:123-150,行号对应 0.1.7-rc.1 的发布产物;为可读性折行,逻辑未改,Windows EPERM 分支已省略):isLockContention()内部也只有一次lstat(lockPath)(第 83 行),同样是判存在。整个文件 152 行里没有一次readFile—— 更直接的是,这个模块从node:fs/promises只导入了lstat, mkdir, rename, rm, writeFile,根本没引入任何读取函数。写进去的 PID 没有任何读取点。源码注释把这件事写成了设计决定:
前半句成立:文件年龄确实证明不了持有者已死。后半句不成立:PID 能证明,而 PID 就写在文件里、只是从来没被读回。把"人工删文件"定为唯一恢复路径的代价是——一次异常退出就让后续每一次 profile 写入白等 120 秒,且跨重启存活。
建议争用时读一下那个 PID,
process.kill(pid, 0)返回 ESRCH 就当持有者已死,删掉锁重试;EPERM 以及任何读不出、不确定的情况一律按"活着"处理,避免在 Windows 上误删活锁。All reactions