-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
[Bug]: Session write lock leaked after embedded run timeout during subagent announce #86816
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Give feedbackNo fields configured for issues without a type.
[Bug]: Session write lock leaked after embedded run timeout during subagent announce
Environment
Description
When a subagent completes and announces its result to the parent session, the announce operation acquires the parent session's write lock and triggers an embedded model call. If this embedded run hits the
timeoutMs(600000ms in our case), the in-memory session write lock is not released, permanently blocking all subsequent writes to that session within the same process.This is similar to #49157 but with a specific trigger path:
subagent completion → announce → embedded run → timeout → lock leak.Steps to Reproduce
thinkingDefault: "adaptive"and multiple subagent spawns (PPT generation workflow with Gen + QA subagents)SessionWriteLockTimeoutErrorindefinitely until gateway restartRelevant Logs
Key Observations
.lockfile itself is deleted after timeout, but the in-memory lock (process-internalHELD_LOCKSmap) is never clearedImpact
Expected Behavior
When an embedded run times out, the session write lock should be released in the timeout handler (finally block / cleanup). The lock should never outlive the operation that acquired it.
Suggested Fix
Add lock release to the embedded run timeout/error path:
Workaround
Restart the gateway (
systemctl --user restart openclaw-gateway-<agent>.service). No configuration change prevents this; it requires a code fix.Related Issues