Skip to content

fix(pty): complete terminal subscription lifecycle - #18

Open
jlongster wants to merge 2 commits into
windows-verificationfrom
windows-subscriptions
Open

fix(pty): complete terminal subscription lifecycle#18
jlongster wants to merge 2 commits into
windows-verificationfrom
windows-subscriptions

Conversation

@jlongster

Copy link
Copy Markdown
Collaborator

Demonstrated subscription fixes

Stacked above #17 / windows-verification at 9f8f85c; lower branches remain frozen and unmerged.

  • Cache the exact final Exited event only after real child exit and reader EOF; late observers/controllers receive it after replay/controller setup.
  • Give each attachment guard a bounded disconnect signal. Dropping the guard wakes a blocked controller send even if callers retain event-receiver clones, then reliably queues Detach.
  • Ignore stale queued Detach messages for a still-live replacement sharing the same string ID.
  • Remove the complete failed subscriber set before promoting a replacement; disconnected guards cannot be promoted.
  • Preserve ordinary controller backpressure, resize-before-input ordering, protocol7, actor-owned Ghostty, and the existing worker architecture. No unbounded detach queue, retry worker, or broader Unix I/O change.

Four small regressions cover late completion/final offset, retained receiver clones with one-slot queues, stale-ID detach, and failed-observer removal before fallback. Extensive probes/generators are not committed.

A separate test-only commit changes the existing foreground fixture to tail --pid=$$ -f /dev/null & sleep 5; every assertion/timing remains unchanged. This ties its background child to the owned shell, not a claimed repair or explanation of prior CI hangs.

Verification

  • Local locked Clippy all targets/features with -D warnings and fmt check pass.
  • Full Linux suite:65 passed (one ignored self-spawned fixture entry).
  • Miri:5 callback +1 retained-pointer tests pass in both Stacked and Tree Borrows.
  • Isolated, hash-recorded trigger probes: late observer/controller completion, saturated ordinary Drop with and without receiver clone, subsequent joined global cleanup all pass. Lifecycle/Unicode and concurrent input/resize checks also pass locally.
  • Native baseline late-attach failure is independently confirmed on both Windows architectures by run33793644572.
  • Native checks of THIS fix and focused remote trigger reruns are pending. Do not merge.

Scope remains the demonstrated controller-send/actor-queue cycle; this does not promise ordinary detach bypasses unrelated native/writer stalls. The excluded Linux blocked-master-write limitation is unchanged.

@jlongster

Copy link
Copy Markdown
Collaborator Author

Both subscription fixes are complete and reviewed. This head passed ordinary native x64/ARM64 (63 tests plus standalone38 each), Linux65/macOS60 and Miri6+6. The final stack in #19 also passes its ordinary native/Core suites and all eight focused regressions on x64. The extra final ARM64 focused job timed out during compilation before running probes; that explicit verification gap and the final evidence links are documented in #19. No further optional retries or merges are being performed.

@jlongster
jlongster marked this pull request as ready for review September 3, 2026 21:05
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