Repository navigation
xprobe/startxfce: tell a stale socket from a live server (bug 24) - #11
Merged
Merged
Conversation
The build-integration half of bug 24 landed in 5aed0ad: xprobe is compiled and staged as /usr/bin/xprobe, so the launcher finally has a liveness probe instead of trusting the bare socket. Three residual paths could still reproduce the same symptom -- reusing a dead display after a persisted /tmp -- so harden the probe and the launcher, and add regression coverage. xprobe: - Bound every socket operation with SO_RCVTIMEO/SO_SNDTIMEO, so a listener that accepts the connection and then says nothing returns instead of hanging the caller. XPROBE_TIMEOUT (default 5s) sets the bound. - Give the exit code a contract: 0 live, 1 not-live (no socket / refused / peer closed), 2 usage, 3 unknown (timeout / permission / auth / bad reply). Everything used to be 1, which erased the "stale and clearable" vs "there but unanswered" distinction that matters when /tmp persists. startxfce: - display_state() prints live, dead or unknown; only "dead" clears the socket, and "unknown" leaves it in place for a server still starting. - With no probe installed, consult /proc/net/unix (exact pathname match, busybox-safe); if it cannot be read the answer is unknown, never live. - Pass XPROBE_TIMEOUT through, and say once when no probe is installed. tests: - tests/xprobe-gate.sh drives the real compiled binary against a synthetic X server (no third-party deps; skips cleanly without a C compiler) and is wired into tests/branch-gate.sh and the ISO workflow. - tests/startxfce-gate.sh gains cases 16-21: the no-probe socket-table fallback, live reuse, unknown-leaves-the-socket, the bounded startup timeout, XPROBE_TIMEOUT passthrough and a probe stuck at "not live". Not verified: a full ISO build and a real two-boot persistence test were not run, so bug 24 stays open in BUGS.md until that boot is done.
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.
What
Bug 24:
startxfcecould announcean X server is already on :0, using itandhand XFCE a display nothing was listening on, once persistence puts
/tmpondisk.
The build-integration half was already fixed in-tree (
5aed0ad:xprobeiscompiled and staged as
/usr/bin/xprobe). This branch closes the residual waysthe same symptom could return, and adds regression coverage.
xprobeSO_RCVTIMEO/SO_SNDTIMEO(
XPROBE_TIMEOUT, default 5s), so an accept-but-silent listener no longerhangs the probe (and the launcher).
0live,1not-live (no socket / refused / peerclosed),
2usage,3unknown (timeout / permission / auth / malformed).Previously every failure was
1.startxfcedisplay_state()returnslive/dead/unknown; the socket is cleared onlyon
deadand left alone onunknown./proc/net/unix(exact path match,busybox-safe); unreadable means
unknown, neverlive.XPROBE_TIMEOUTthrough and says once when no probe is present.Tests
tests/xprobe-gate.sh(new): drives the real compiled binary against asynthetic X server; no third-party deps; skips cleanly without a C compiler.
Wired into
tests/branch-gate.shand the ISO workflow.tests/startxfce-gate.sh: cases 16-21 (no-probe fallback, live reuse,unknown-leaves-the-socket, bounded startup timeout,
XPROBE_TIMEOUTpassthrough, probe stuck at "not live").
Verification
tests/startxfce-gate.sh- 21 cases / 84 checks, pass.tests/xprobe-gate.sh- 18 checks, pass.tests/branch-gate.sh- both new gates pass. (smoke.shandcharge.shfail for pre-existing, unrelated reasons in this checkout: no built
copper-sh; they fail identically with this branch stashed.)Not verified
No full ISO build and no real two-boot persistence test were run, so bug 24
stays open in
BUGS.mduntil that boot is done.