openclaw - 💡(How to fix) Fix [Bug]: session-write-lock timeout (10s) is shorter than legitimate lock holds (40-55s) on v2026.4.29 prep stages — needs config knob [1 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#75894Fetched 2026-05-02 05:28:23
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
2
Author
Timeline (top)
commented ×1

Error Message

[diagnostic] message processed: ... outcome=error duration=33935ms error="SessionWriteLockTimeoutError: session file locked (timeout 10000ms)" [session-write-lock] releasing lock held for 55611ms (max=15000ms) [trace:embedded-run] prep stages: ... totalMs=113809 [diagnostic] liveness warning: eventLoopDelayP99Ms=44090.5

Code Example

[diagnostic] message processed: ... outcome=error duration=33935ms
 error="SessionWriteLockTimeoutError: session file locked (timeout 10000ms)"
[session-write-lock] releasing lock held for 55611ms (max=15000ms)
[trace:embedded-run] prep stages: ... totalMs=113809
[diagnostic] liveness warning: eventLoopDelayP99Ms=44090.5
RAW_BUFFERClick to expand / collapse

OpenClaw 2026.4.29 (a448042) has a user-visible failure mode where legitimate session-write locks last 40-55s+ during slow prep stages, but at least one call site still uses a hard-coded 10s lock acquire timeout.

Evidence from gateway journal on 2026-05-02 UTC:

[diagnostic] message processed: ... outcome=error duration=33935ms
 error="SessionWriteLockTimeoutError: session file locked (timeout 10000ms)"
[session-write-lock] releasing lock held for 55611ms (max=15000ms)
[trace:embedded-run] prep stages: ... totalMs=113809
[diagnostic] liveness warning: eventLoopDelayP99Ms=44090.5

Local investigation:

  • dist/extensions/codex/run-attempt-DgEHs5eR.js calls acquireSessionWriteLock({ sessionFile: params.sessionFile, timeoutMs: 1e4 }).
  • dist/docker-C3gkMNg9.js uses timeoutMs: 6e4 for another lock, so 60s is already considered acceptable in at least one path.
  • transcript-rewrite-D-wdJFRv.js calls acquireSessionWriteLock({ sessionFile: params.sessionFile }), inheriting the helper default.
  • Config schema exposes agents.defaults.maxConcurrent, but I could not find a config key for session write lock acquire timeout. These paths appear hard-coded or defaulted, not configurable.

Impact:

When the gateway is under cron/agent prep load, interactive Telegram messages can fail with “Something went wrong while processing your request” even though the blocking lock is legitimate and releases shortly after.

Request:

  • Add a config knob for session write lock acquire timeout, e.g. session.lockTimeoutMs or agents.defaults.session.lockTimeoutMs.
  • Consider raising the default above 10s while v2026.4.29 prep stages are routinely 40-110s.
  • Ensure all acquireSessionWriteLock call sites use the knob instead of hard-coded 1e4.

extent analysis

TL;DR

Increase the session write lock acquire timeout to a value greater than 10s, potentially through a new config knob, to prevent timeouts during slow prep stages.

Guidance

  • Review all acquireSessionWriteLock call sites to identify hard-coded timeouts and consider replacing them with a configurable value.
  • Evaluate the current default timeout of 10s and consider increasing it to a value between 40s to 60s to accommodate slow prep stages.
  • Investigate adding a config key, such as session.lockTimeoutMs or agents.defaults.session.lockTimeoutMs, to allow for customization of the session write lock acquire timeout.
  • Test the updated configuration to ensure that interactive Telegram messages no longer fail with "Something went wrong while processing your request" errors during cron/agent prep load.

Example

// Example of using a configurable timeout
const sessionLockTimeoutMs = getConfig('session.lockTimeoutMs', 60000); // default to 60s
acquireSessionWriteLock({ sessionFile: params.sessionFile, timeoutMs: sessionLockTimeoutMs });

Notes

The ideal timeout value may vary depending on the specific use case and performance characteristics of the system. It's essential to monitor the system's behavior after making changes to ensure that the updated timeout value effectively prevents timeouts without introducing other issues.

Recommendation

Apply a workaround by increasing the default timeout value to a higher value, such as 60s, until a config knob can be added to allow for customization. This should help prevent timeouts during slow prep stages and reduce errors.

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 [Bug]: session-write-lock timeout (10s) is shorter than legitimate lock holds (40-55s) on v2026.4.29 prep stages — needs config knob [1 comments, 2 participants]