Skip to content

fix: release broker state during dead session cleanup - #251

Merged
ejgallego merged 1 commit into
mainfrom
codex/dead-session-cleanup
Sep 3, 2026
Merged

ejgallego merged 1 commit into
mainfrom
codex/dead-session-cleanup

Conversation

@ejgallego

@ejgallego ejgallego commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

This PR prevents cleanup of an exited backend worker from blocking unrelated Beam workspaces while preserving workspace-generation isolation.

  • Atomically detach an exited session before performing its bounded shutdown outside the broker state mutex.
  • Retry only while the request's original workspace generation remains current; reject a concurrent reset with contentModified instead of touching the replacement workspace.
  • Cover both inherited stdio held by a worker descendant and reset during the resulting cleanup window.

@ejgallego
ejgallego force-pushed the codex/dead-session-cleanup branch from f07b3cf to e5a89fa Compare September 3, 2026 19:31
@ejgallego
ejgallego force-pushed the codex/dead-session-cleanup branch from e5a89fa to 40e0c5c Compare September 3, 2026 19:50
@ejgallego
ejgallego marked this pull request as ready for review September 3, 2026 20:17
@ejgallego
ejgallego merged commit 8276f4e into main Sep 3, 2026
31 checks passed
@ejgallego
ejgallego deleted the codex/dead-session-cleanup branch September 3, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant