Repository navigation
Reap orphaned plugin watchers at shell start - #15299
Merged
Merged
Conversation
Contributor
|
Contributor
Author
|
Greptile addressed in the latest commit:
|
Contributor
Author
|
Greptile round 2 addressed: the stand-in parent now polls its child (no zombie false-survivor), the test asserts the survivor is not a zombie, and the cleanup trap tolerates pkill finding nothing. Test passes. |
Quickshell does not take its Process children with it when it stops, so every shell restart left the plugin-directory inotifywait running, reparented to init — 79 of them on one machine. Stop the watcher on a graceful destruction, and at startup, before starting our own, stop any plugin watcher whose parent is no longer a shell. A live shell's watcher, parented to it, is spared.
Greptile: a substring match also caught a watcher of plugins-backup; the test copied the reap instead of running it and only looked for a live watcher after reaping. The reaper now matches a whole command-line argument, and the test extracts the real reap command from PluginRegistry.qml, finds its live watcher (a stand-in named quickshell) before reaping, and checks it and a similarly named directory's watcher survive.
Greptile: the stand-in parent never waited, so a killed watcher could linger as a zombie that kill -0 still sees; poll the child, check the survivor is not a zombie, and let the cleanup trap run when pkill finds nothing.
dhh
force-pushed
the
fix/plugin-watcher-orphans
branch
from
October 14, 2026 01:24
1898d58 to
74f872c
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.
What
Quickshell does not take its
Processchildren with it when it stops, so every shell restart left the plugin-directoryinotifywait(PluginRegistry.localPluginWatcher) running, reparented to init — 79 on this machine (the runtime-smoke test already works around the same leak for its scratch shells).Component.onDestruction: stop the restart timer and the watcher on a graceful stop.inotifywaitthat watches this shell's plugins directory but whose parent is no longer a shell. A live shell's watcher (parented to it) and watchers of other directories are left alone.Verification
test/shell.d/plugin-watcher-reap-test.sh: lifecycle wiring, orphan reaped, unrelated-directory watcher spared, live shell's watcher spared. Running it here took the machine from 81 plugin watchers to the one live shell's.inotifywaitwith the same flags was being killed); fixed and re-reviewed clean.From plans/overnight-quality.md §3 (orphaned plugin watchers).