Repository navigation
fix(zellij): find headless clients by process, retry failed listings (RIG-6930) - #100
Merged
Merged
Conversation
…(RIG-6930) Review follow-up to #99. The handoff kept its headless client in a per-process map, so a survivor of an earlier manager was never stopped, and it detached on a raw client count of two, which another headless client or a leaving client could satisfy. A transient list-clients error also failed every unbounded caller at once. Find headless clients from /proc by their attach command, as process-group leaders. Keep one only while no other client is attached, stop the rest, and re-check the listing after stopping so a client that left meanwhile gets a replacement. Retry a failed listing within the existing attach budget. Test: package.smoke.ts adds a flaky-listing cell, a client leaving during handoff, and two survivors from earlier managers. The fake client forks a descendant, so a wrapper-only kill fails. The three new cells fail on the #99 driver. A live throwaway-session smoke shows the headless client exits after a real client attaches. Refs RIG-6930 Spec-impact: none Co-authored-by: Matt Wilkinson <matt@rigel.build>
…ed clients (RIG-6930) Review of #100: - high: without /proc no client was ever stopped. Fall back to the groups this process started. - medium: a kept headless client that had not connected was joined by a second one. Keep one only while it is the sole attached client; otherwise stop it and start one. An unknown listing after stopping is retried, never read as zero. - medium: a scanned PID was killed as a bare number. Match the exact script argv, our UID and group leadership, and re-check just before each kill. - low: skip the /proc scan when exactly one client is attached, the steady state. Test: a new cell for an unattached survivor fails on the previous head. The /proc cells skip explicitly where /proc is absent. 43 checks pass; a live throwaway-session smoke shows a clean handoff. Refs RIG-6930 Spec-impact: none Co-authored-by: Matt Wilkinson <matt@rigel.build>
…IG-6930) Review medium on #100: with one listed client, ensureClient skips the scan, so a survivor beside a real client is not stopped at once. list-clients cannot say which client is real, and stopping the group could remove the only client. An unconnected survivor holds no client state in the zellij server. Once it attaches, the listing shows two clients against one group, and the next call stops it. At most one such group lingers, and only until it attaches. The new cell checks that: kept while unattached, stopped after it attaches, and no client started. 44 checks pass. Refs RIG-6930 Spec-impact: none Co-authored-by: Matt Wilkinson <matt@rigel.build>
Matt accepted option A on RIG-6941: an unattached headless survivor beside one real client stays until it attaches or the manager restarts, since list-clients has no process identity. Records that limit at the scan skip. Refs RIG-6941, RIG-6930 Spec-impact: none Co-authored-by: Matt Wilkinson <matt@rigel.build>
Author
|
Review note at 87521eb (base rigel-release a5451b8): three review rounds; no open high or medium. Findings fixed: transient list-clients retry, keep-one handoff with post-stop re-check, survivors of earlier managers found from /proc with argv, group-leader and UID checks before each kill, own-group fallback without /proc, scan skipped at one client. The remaining medium (an unattached survivor beside one real client) is accepted by Matt as option A on RIG-6941 and documented in the driver. 44 zellij package checks pass; the new cells fail on the previous heads; a live throwaway-session smoke shows a clean handoff. |
rigel-mintaka
marked this pull request as ready for review
October 30, 2026 20:43
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.
Review follow-up to #99. The handoff kept its headless client in a per-process map, so a survivor of an earlier manager was never stopped, and it detached on a raw client count of two, which another headless client or a leaving client could satisfy. A transient list-clients error also failed every unbounded caller at once.
Find headless clients from /proc by their attach command, as process-group leaders. Keep one only while no other client is attached, stop the rest, and re-check the listing after stopping so a client that left meanwhile gets a replacement. Retry a failed listing within the existing attach budget.
Test: package.smoke.ts adds a flaky-listing cell, a client leaving during handoff, and two survivors from earlier managers. The fake client forks a descendant, so a wrapper-only kill fails. The three new cells fail on the #99 driver. A live throwaway-session smoke shows the headless client exits after a real client attaches.
Refs RIG-6930
Spec-impact: none
Co-authored-by: Matt Wilkinson matt@rigel.build
Approved-at: 87521eb