Kill the local plugin watcher with the shell via pdeathsig - #11385
Open
chadmandoo wants to merge 1 commit into
Open
Kill the local plugin watcher with the shell via pdeathsig#11385chadmandoo wants to merge 1 commit into
chadmandoo wants to merge 1 commit into
Conversation
The plugin watcher ran as a bare Process, so an exit that skips destructors left it behind. Qt leaves through _exit() when the Wayland connection fails, raising no signal, and the inotifywait was then reparented to `systemd --user` where it held an inotify instance for the rest of the session. A deliberate omarchy-restart-shell does stop it cleanly; the crash path does not. Enough of them exhaust fs.inotify.max_user_instances, 1024 per UID, after which every inotify_init1() in the session fails with EMFILE. The error then surfaces in whatever application next asks for a watch, with no hint of where it came from. A lock-path crash loop relaunched the shell 4437 times here and stranded 979 watchers, taking the user to 1025 of 1024 instances; Alacritty was the first thing to refuse to start. The clipboard watchers already solve this with setpriv --pdeathsig TERM, so this applies the established idiom to the plugin watcher and asserts it in plugins-test.sh the same way clipboard-test.sh does. Closes omacom#11383 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
chadmandoo
force-pushed
the
plugin-watcher-pdeathsig
branch
from
September 11, 2026 23:10
a1d2410 to
f67f285
Compare
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.
Closes #11383.
PluginRegistryspawned the local-plugin watcher as a bareProcess, so an exit that skips destructors left it running: Qt leaves through_exit()when the Wayland connection fails, raising no signal. Theinotifywaitwas reparented tosystemd --userand held an inotify instance for the rest of the session. A deliberateomarchy-restart-shelldoes stop it cleanly — I measured an unpatched shell across a restart and it left no orphan — so this is the crash path specifically.Enough of them exhaust
fs.inotify.max_user_instances(1024 per UID), after which everyinotify_init1()in the session fails withEMFILE. The error then surfaces in whatever application next asks for a watch, with nothing pointing back at the shell. On my machine a lock-path crash loop relaunched the shell 4437 times and stranded 979 watchers, taking the user to 1025 of 1024 instances; Alacritty was the first thing to refuse to start, with "too many open files".The fix
shell/plugins/clipboard/Clipboard.qmlalready solves this, and says so:This applies the same
setpriv --pdeathsig TERMidiom to the plugin watcher, which was the only long-livedProcesschild undershell/still missing it.Testing
Verified through Quickshell's real spawn path (Quickshell 0.3.1, Omarchy 4.0.3) with a minimal config, killing the shell with
SIGKILLso no destructor runs:kill -9of the shellsystemd --userAlso checked for regressions in the watcher itself:
inotifywaitundersetprivstill reportscreateandclose_writeevents normally, and the child was still alive after 12 seconds with the shell running, soPDEATHSIGisn't firing early on the spawning thread.test/shell.d/plugins-test.shgains an assertion mirroring the two inclipboard-test.sh. It fails on the unpatched tree and passes with the change.Ran the whole
test/shell.dsuite: 237 test files, 3 with failures —config-test.sh,snapper-test.shandunowned-system-paths-test.sh, all three asking for anomarchy-pkgscheckout I don't have. They fail identically on an unmodified tree.Not addressed here
The crash loop that exposed this looks like Quickshell's, not Omarchy's — the shell dies in lock-surface creation when the session is locked and the compositor has no valid Wayland output (
Could not create EGL surface (EGL error 0x3000), thenThe Wayland connection experienced a fatal error: Invalid argument), and that string isn't in this repo. The watcher should not outlive the shell regardless of what kills it.One related observation for whoever picks that up: the relaunch limiter in
bin/omarchy-launch-shellallows 5 relaunches per 60-second window and resets the window on expiry, so a loop slower than 5/minute runs indefinitely inside the limit. Mine crashed about every 13 seconds and never tripped it.🤖 Generated with Claude Code