fix: wrap waitForCompactionRetry with abort signal to prevent session lock leak#12227
Closed
Yida-Dev wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix: wrap waitForCompactionRetry with abort signal to prevent session lock leak#12227Yida-Dev wants to merge 1 commit intoopenclaw:mainfrom
Yida-Dev wants to merge 1 commit intoopenclaw:mainfrom
Conversation
After an embedded run is aborted, waitForCompactionRetry() can hang indefinitely because it waits for compaction events that may never arrive post-abort. This prevents the finally block from executing, so clearActiveEmbeddedRun() and sessionLock.release() are never called — leaving the session permanently locked and unresponsive. Wrap the call with the existing abortable() helper (same pattern used for activeSession.prompt() on line 820-822) so the abort signal properly interrupts the compaction wait. Closes openclaw#12085 Co-Authored-By: Claude Opus 4.6 <[email protected]>
bfc1ccb to
f92900f
Compare
4 tasks
Member
|
Closing as duplicate of #15449. If this is incorrect, please contact us. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
waitForCompactionRetry()hangs indefinitely because it waits for compaction events that never arrive post-abortfinallyblock from executing, soclearActiveEmbeddedRun()andsessionLock.release()are never calledACTIVE_EMBEDDED_RUNSand the.lockfile remains — the agent becomes permanently unresponsive until gateway restartwaitForCompactionRetry()with the existingabortable()helper, matching the pattern already used foractiveSession.prompt()on lines 820-822Test plan
abortable()pattern used 2 lines above foractiveSession.prompt()Closes #12085
Co-Authored-By: Claude Opus 4.6 [email protected]
Greptile Overview
Greptile Summary
This change wraps the
waitForCompactionRetry()await in the existingabortable()helper insiderunEmbeddedAttempt(). That ensures an external abort/timeout can break out of the post-prompt compaction wait and allow the surroundingfinallyblocks to run, preventing embedded session state (including the session write lock) from being left behind in a stuck state after an aborted run.The implementation matches the established pattern already used for
activeSession.prompt()in the same function, so behavior stays consistent across the two long-running awaits in the embedded run lifecycle.Confidence Score: 5/5
abortable()helper, localized to the embedded run attempt flow. It aligns with the existing abort handling pattern used foractiveSession.prompt()and directly addresses a hang that could prevent the cleanupfinallyblocks from releasing session state and locks.