fix(wayland): a process table glass cannot read is not an absent Xwayland - #525
Merged
Conversation
…land (fixes #381) `session_display` returned `None` for four different reasons and `recover_if_due` read all of them as the one that is expected — a native Wayland app with no X11 side. An unreadable `/proc`, or an unreadable `environ`/`cmdline` on the session's own Xwayland, switched lost-window recovery off for the life of the session with nothing said, after which `list_windows` reported the compositor's shorter list as fact. The scans now separate "looked and found nothing" from "could not look": `Ok(None)` is the native Wayland session and nothing else, and an `Err` goes through the same warn-once path as a failed `XProbe::connect`. A read failure before the runtime-dir match stays a silent skip — that is what another user's Xwayland, or one that exited mid-scan, correctly looks like. `session_processes` swallowed the same `read_dir("/proc")` failure, and doctor's leak accounting read the empty list as "the probe left nothing running" — deleting the probe's runtime dir out from under whatever still held sockets in it. It now reports that it could not tell, and keeps the dir. The process table is a parameter to the scans, so the branches that decide whether recovery runs are covered against a built one: no `/proc`, an entry whose files cannot be read, an Xwayland with no display argument, and one serving another session. Verified by ablation — reinstating each swallow fails the tests that name it. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
… per session Review of the previous commit: a `/proc` failure took the session's single warning slot, after which a genuine `XProbe::connect` failure was silent — the asymmetry #381 is about, one branch over. `warned` now records which step failed, so a failure of a different kind is still said once, and the read path no longer has to clear the flag by hand to get that. Also from review: the pre-match skip is shown on a table whose only entry is the unreadable one, so the answer cannot come from a second entry the scan happened to reach first; the no-display error names what it rejected (a screen- or host-qualified argument is not "no display argument"); the `/proc` reads that stay silent say why; and the fixture no longer claims CI runs as root, which it does not. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comments only — no code changed. The review-fix commit's new comments had not been through the pass the first one had: each now carries its fact without the sentence restating it (205 words to 142). Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comments only. Run over the branch as a whole rather than per commit, which is what surfaces a fact stated in two commits at once: the "survivor glass cannot name" fact sat on `Leaked`, its `unknown` field and `leak_notice`; "cannot be arranged in a real /proc" sat on the `PROC` const, the fixture and the module doc; and three test docs restated the pre/post-match rationale their code comments already carry. Each now has one home; the tests name what they pin. 1474 words to 1282 across the changeset. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Fixes #381.
session_displayreturnedNonefor four different reasons andrecover_if_dueread all of them as the one that is expected — a native Wayland app with no X11 side. An unreadable/proc, or an unreadableenviron/cmdlineon the session's own Xwayland, switched lost-window recovery off for the life of the session with nothing said, after whichlist_windowsreported the compositor's shorter list as fact.The scans now separate "looked and found nothing" from "could not look".
Ok(None)is the native Wayland session and nothing else; anErris reported like a failedXProbe::connect. A read failure before the runtime-dir match stays a silent skip — that is what another user's Xwayland, or one that exited mid-scan, correctly looks like.Recovery::warnedrecords which step failed rather than that something did, so a/procfailure no longer consumes the line a later connect failure would have said (the same asymmetry, one branch over).session_processesswallowed the sameread_dir("/proc")failure, and doctor's leak accounting read the empty list as "the probe left nothing running" — deleting the probe's runtime dir out from under whatever still held sockets in it. It now reports that it could not tell, and keeps the dir. A failed scan is retried within the existing 500 msLEAK_GRACE, since a host out of file descriptors is the transient that wait is there for.Verification
glass-waylandunit tests; 93 workspace test binaries; 0 failures.cargo clippy --workspace --all-targets -- -D warningsandcargo fmt --checkclean.#[ignore]d real-session tests pass against a live sway/Xwayland (--include-ignored)./proc, an entry whose files cannot be read, an Xwayland with no:Nargument, one serving another session, and a table whose only entry is unreadable.