Repository navigation
Stop OSD frontends from outliving a killed daemon - #926
Open
KitsuneKode wants to merge 1 commit into
Open
KitsuneKode wants to merge 1 commit into
KitsuneKode wants to merge 1 commit into
Conversation
The supervisor relied on kill_on_drop, which only fires when the supervisor task is dropped during an orderly shutdown. A daemon that was killed or crashed left its `qs` child running, re-parented to init and still drawing a pill; the next daemon then drew a second one on top. Four such orphans had piled up on one machine in an afternoon of testing. On Linux, have the kernel deliver SIGTERM to the child when the daemon dies (PR_SET_PDEATHSIG, set before exec, so it carries through the dispatcher's exec into the frontend), with the usual getppid() check for a daemon that died between fork and prctl.
KitsuneKode
force-pushed
the
fix/osd-outlives-daemon
branch
from
November 24, 2026 10:53
a5402d1 to
2ba786a
Compare
KitsuneKode
marked this pull request as ready for review
November 24, 2026 10:53
Author
|
Rebased onto current |
This branch has not been deployed
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.
Description
The OSD supervisor relied on
kill_on_drop, which only fires when the supervisor task is dropped during an orderly shutdown, so a killed or crashed daemon left its OSD running and the next daemon drew a second one.On Linux, the child now gets
PR_SET_PDEATHSIG(SIGTERM) before exec, so the kernel stops it when the daemon dies, however it dies. The setting carries through the dispatcher's exec into the frontend. Agetppid()check covers a daemon that died between fork and prctl. Other platforms are unchanged.Related Issue
Fixes #922
Type of Change
Testing
kill -9on the daemon takes itsqsdown with it, and after systemd restarts the daemon there is exactly oneqs, parented to the new daemoncargo testand all tests passcargo clippy -- -D warningswith no warnings, apart from theclippy::double_must_uselint that current stable also reports ondevcargo fmtDocumentation
Pre-merge checklist
devbranch (notmain)ci-successto pass before marking Ready for Review (draft mode is encouraged while CI is red)Additional Notes
#879 also edits
src/osd/supervisor.rs(the binary lookup); the two changes are in different functions.