openclaw - 💡(How to fix) Fix session file locked timeout mismatch: 60s wait vs 17min hold

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

{
  "pid": 32504,
  "createdAt": "2026-05-26T07:22:46.211Z",
  "maxHoldMs": 1020000,
  "starttime": 7204072
}
RAW_BUFFERClick to expand / collapse

版本

OpenClaw 2026.5.22 (a374c3a)

问题描述

会话写入时频繁报错 session file locked (timeout 60000ms),导致模型回复中途中断。

根因分析

session lock 的 maxHoldMs: 1,020,000(17分钟)与写入者的等待超时 60,000ms(60秒)严重不匹配。

锁文件内容:

{
  "pid": 32504,
  "createdAt": "2026-05-26T07:22:46.211Z",
  "maxHoldMs": 1020000,
  "starttime": 7204072
}

当同一个进程内多个写操作竞争锁时,持锁者最多持有 17 分钟,但等待者 60 秒就超时。

复现条件

  • WSL2 环境
  • 高频 exec 工具调用
  • 会话持续时间较长后容易触发

建议修复

  1. 将写入等待超时对齐 maxHoldMs,或使其可配置
  2. 或缩短 maxHoldMs 到合理值(如 30-60 秒)
  3. 考虑使用异步写入队列代替文件锁竞争

缓解措施

定期清理旧 session减少 IO 压力 (724MB → 328MB),但无法根除。

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix session file locked timeout mismatch: 60s wait vs 17min hold