Skip to content

fix(desktop-lite): race condition on X11 socket - #555

Merged
sjinks merged 1 commit into
trunkfrom
fix-race
Jul 27, 2026
Merged

sjinks merged 1 commit into
trunkfrom
fix-race

Conversation

@sjinks

@sjinks sjinks commented Jul 27, 2026

Copy link
Copy Markdown
Member

This pull request improves the reliability of the desktop-lite feature by ensuring that the X server and related processes are available before starting dependent services or running checks. It also bumps the feature version to reflect these changes.

Reliability and startup synchronization:

  • Added a wait loop in entrypoint.tpl to ensure that the X server socket (/tmp/.X11-unix/X0) is available before starting openbox and easy-novnc, exiting with an error if unavailable.
  • Updated checks.sh to wait for the X server, openbox, and easy-novnc processes to be running before performing service checks, improving test robustness.

Versioning:

  • Bumped the desktop-lite feature version from 1.1.0 to 1.1.1 in devcontainer-feature.json.

@sjinks sjinks self-assigned this Jul 27, 2026
Copilot AI review requested due to automatic review settings July 27, 2026 22:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves desktop-lite startup reliability by synchronizing dependent services/tests with X11/VNC readiness, and bumps the feature version accordingly.

Changes:

  • Add an X11 socket wait-and-fail loop in entrypoint.tpl before starting openbox and easy-novnc.
  • Add pre-check waits in the test checks.sh for X11 socket and key processes.
  • Bump desktop-lite feature version from 1.1.0 to 1.1.1.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
features/test/desktop-lite/checks.sh Adds readiness waits, but currently removes post-restart waits and doesn’t fail fast on startup timeouts.
features/src/desktop-lite/entrypoint.tpl Waits for /tmp/.X11-unix/X0 before launching dependent desktop services; exits with error if unavailable.
features/src/desktop-lite/devcontainer-feature.json Version bump to reflect reliability changes.
Comments suppressed due to low confidence (3)

features/test/desktop-lite/checks.sh:27

  • After sv start tigervnc, the script immediately asserts run: without waiting for the service to actually transition to running. This can reintroduce the same race/flakiness that the earlier retry loop avoided.
    sudo sv stop tigervnc
    check "tigervnc is stopped" sudo sh -c 'sv status tigervnc | grep -E ^down:'
    sudo sv start tigervnc
    check "tigervnc is running" sudo sh -c 'sv status tigervnc | grep -E ^run:'

features/test/desktop-lite/checks.sh:33

  • After sv start openbox, the script immediately asserts run: without waiting for the service to actually transition to running, which can make this test flaky under load.
    sudo sv stop openbox
    check "openbox is stopped" sudo sh -c 'sv status openbox | grep -E ^down:'
    sudo sv start openbox
    check "openbox is running" sudo sh -c 'sv status openbox | grep -E ^run:'

features/test/desktop-lite/checks.sh:39

  • After sv start novnc, the script immediately asserts run: without waiting for the service to actually transition to running. The previous retry loop was guarding against this race.
    sudo sv stop novnc
    check "novnc is stopped" sudo sh -c 'sv status novnc | grep -E ^down:'
    sudo sv start novnc
    check "novnc is running" sudo sh -c 'sv status novnc | grep -E ^run:'

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread features/test/desktop-lite/checks.sh
@sjinks
sjinks merged commit 5527851 into trunk Jul 27, 2026
203 of 205 checks passed
@sjinks
sjinks deleted the fix-race branch July 27, 2026 22:26
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.

2 participants