Skip to content
This repository was archived by the owner on Aug 22, 2026. It is now read-only.

Retry Wayland display on transient EAGAIN instead of restarting - #3

Open
jvasile wants to merge 4 commits into
hholst80:masterfrom
jvasile:retry-eagain
Open

Retry Wayland display on transient EAGAIN instead of restarting#3
jvasile wants to merge 4 commits into
hholst80:masterfrom
jvasile:retry-eagain

Conversation

@jvasile

@jvasile jvasile commented Aug 21, 2026

Copy link
Copy Markdown

Adds handling for transient Wayland display unavailability surfaced by
pywayland as RuntimeError "Failed with error: 11" (errno.EAGAIN).
Previously both RiverWM event loops treated any RuntimeError as fatal,
setting crash_reason and breaking to trigger a restart which would
log-loop on temporary unavailability. The new helper retries on this
transient failure, backing off slowly to avoid spamming the logs or
taking too much system attention.

This code preserves the existing fatal path for EPIPE, EPROTOCOL and other errors.

In addition, I've added some tests.

This MR also has some commits related to making sure pip can find all the pieces. They're not substantive, but they are needed for this to work in my (and perhaps other's) system.

Adds a [tool.setuptools] section to pyproject.toml declaring py-modules
= ["wm2"] so the single-file wm2 module is correctly discovered and
included when building distributions, complementing the existing
[project.scripts] entry for the wm2 console script and ensuring
installability via setuptools without requiring a package directory.

This makes `pip install .` work.  Without it, .venv/bin/wm2 fails when
it can't find the wm2 module.

- Adds [tool.setuptools] with py-modules = ["wm2"] to pyproject.toml to
include the top-level module in builds
Adds a [tool.setuptools.packages.find] section to pyproject.toml with
include = ["protocols*"] so that any packages under the protocols
namespace are discovered and included in built distributions. This
complements the existing py-modules entry for wm2 and ensures the
protocols code is packaged and installed rather than being excluded by
default package discovery.

- Adds [tool.setuptools.packages.find] with include = ["protocols*"] to
pyproject.toml
- Retains existing [tool.setuptools] py-modules configuration for wm2
Set pytest's pythonpath to the repository root so tests can import the top-level wm2 module when pytest is invoked directly. This makes local test discovery work consistently with the project's flat module layout.
Adds handling for transient Wayland display unavailability surfaced by
pywayland as RuntimeError "Failed with error: 11" (errno.EAGAIN).
Previously both RiverWM event loops treated any RuntimeError as fatal,
setting crash_reason and breaking to trigger a restart which would
log-loop on temporary unavailability. The new helper retries on this
transient failure, backing off slowly to avoid spamming the logs or
taking too much system attention.

This code preserves the existing fatal path for EPIPE, EPROTOCOL and
other errors.

In addition, I've added some tests.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant