Repository navigation
Perf: Watch the systemd-coredump directory with inotify instead of following the journal #7155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
felixzsh
wants to merge
12
commits into
omacom:quattro
Choose a base branch
from
felixzsh:perf-crash-watch-memory
base: quattro
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
cf3e526
Watch the coredump directory instead of following the journal stream
felixzsh 82b6f6a
Restart the crash watcher during updates so the inotify rewrite applies
felixzsh 32c321d
Potential fix for pull request finding
felixzsh db0d5d3
Split the mocked inotifywait output with tr instead of word-splitting
felixzsh 1747db6
Retry the crash details lookup so the journal entry has time to land
felixzsh 23dea09
fix(crash-watch): handle an empty comm and a missing executable
felixzsh 43cde77
fix(crash-watch): let a failed restart fail the migration
felixzsh 6c2a9e3
fix(crash-watch): watch coredump completion by invocation
felixzsh b02d4d2
test(crash-watch): skip unavailable host integration checks
felixzsh 380889c
test(crash-capture): keep one crash watcher suite
felixzsh 8e16cbb
fix(crash-watch): flush the OOM stream so a kill announces at once
felixzsh f965939
fix(migration): wait for the package's files instead of failing the u…
felixzsh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
10 changes: 10 additions & 0 deletions
10
etc/systemd/system/systemd-coredump@.service.d/10-omarchy-crash-events.conf
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [Service] | ||
| # Only the handler writes here; user watchers need names, not file contents. | ||
| RuntimeDirectory=omarchy-crash-events | ||
| RuntimeDirectoryMode=0755 | ||
| RuntimeDirectoryPreserve=yes | ||
| # Emitted after processing, independent of Storage= and core size limits. | ||
| # Each invocation is unique; deleting the marker does not erase its inotify event. | ||
| # Notification plumbing must never make coredump processing fail. | ||
| ExecStopPost=-/usr/bin/touch -- /run/omarchy-crash-events/${INVOCATION_ID} | ||
| ExecStopPost=-/usr/bin/rm -f -- /run/omarchy-crash-events/${INVOCATION_ID} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Create before user watchers start, not only when the first crash happens. | ||
| d /run/omarchy-crash-events 0755 root root - |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| echo "Enable coredump completion events and restart the crash watcher" | ||
|
|
||
| # Package-owned drop-ins are already installed. Create the event directory | ||
| # without waiting for reboot and load ExecStopPost for future coredumps. | ||
| sudo systemd-tmpfiles --create /etc/tmpfiles.d/omarchy-crash-events.conf | ||
|
felixzsh marked this conversation as resolved.
Resolved
|
||
| sudo systemctl daemon-reload | ||
|
|
||
| # The unit's ConditionPathExists re-checks the same toggle flag at every | ||
| # start, so a watcher the user disabled stays off: honoring the flag here | ||
| # makes this migration a no-op for them. Only nudge a watcher that is | ||
| # actually running; a stopped one stays stopped. A requested restart is left | ||
| # to fail loudly: the migration stays unmarked so omarchy-migrate retries it, | ||
| # instead of recording a success the watcher did not get. | ||
| [[ -f "$HOME/.local/state/omarchy/toggles/crash-capture-off" ]] && exit 0 | ||
|
|
||
| if systemctl --user is-active --quiet omarchy-crash-watch.service; then | ||
| systemctl --user restart omarchy-crash-watch.service | ||
| fi | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.