Skip to content

fix(terminal): dispose grouped session when tmux attach fails#160

Open
dsfaccini wants to merge 2 commits into
gbasin:masterfrom
dsfaccini:fix/dispose-grouped-session-on-attach-fail
Open

fix(terminal): dispose grouped session when tmux attach fails#160
dsfaccini wants to merge 2 commits into
gbasin:masterfrom
dsfaccini:fix/dispose-grouped-session-on-attach-fail

Conversation

@dsfaccini

Copy link
Copy Markdown
Contributor

This pull request was posted by AICA on behalf of David.

Summary

  • PtyTerminalProxy.doStart creates the grouped …-ws-<uuid> session before spawning tmux attach.
  • If that spawn throws, the catch used to mark the proxy DEAD and rethrow without tearing the grouped session down.
  • That orphans a tmux session (and its pty) until the next restart reaper — the same leak class as long-lived pty-pool exhaustion under repeated attach failures.
  • Fix: call await this.dispose() on the attach-spawn failure path, matching the other error/cancel paths in doStart.
  • Regression test: attach spawn throws → expect kill-session on the grouped session name.

Test plan

  • bun test src/server/__tests__/isolated/terminalProxy.test.ts (13 pass, including new case)
  • CI green on this PR

doStart creates the grouped …-ws-<uuid> session before spawning
tmux attach. If that spawn throws, tear the session down via dispose()
instead of only marking DEAD — otherwise the orphan holds a pty until
the next restart reaper.
package.json optionalDependencies were bumped to 0.4.4 but bun.lock still
listed 0.4.3, so `bun install --frozen-lockfile` fails on CI (and locally).
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