会话锁释放补强,修复 .lock 长期占用导致模型调用卡死(PR #15021)
解决 session file locked timeout 持续出现的场景:补齐 write/close/finally 异常路径的锁清理逻辑,降低死锁与僵尸锁概率。
GITHUBDiscovered 2026-02-13Author shtse8
Prerequisites
- You can access OpenClaw host filesystem and inspect lock file paths.
- Current deployment has observed lock-timeout errors or stale .lock files.
- A maintenance window is available for restart and stress replay.
Steps
- Collect baseline logs for session file locked errors and count existing lock files.
- Upgrade to a build that includes PR #15021 and restart gateway.
- Replay concurrent workloads (or synthetic burst requests) for 10-15 minutes.
- Observe lock lifecycle: creation during write, cleanup after completion, and no persistent orphan files.
- If residual timeouts remain, isolate storage latency or plugin dispose errors as secondary root causes.
Commands
openclaw gateway statusopenclaw gateway restartopenclaw statusfind ~/.openclaw -name '*.lock' | wc -lVerify
After stress replay, lock-timeout errors no longer spike and stale lock files do not accumulate indefinitely.
Caveats
- The patch reduces lock leaks, but overloaded disks or abrupt process kills can still cause transient contention.
- Manual lock-file deletion on active systems is risky; perform only in controlled maintenance windows(需验证)。
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗