omarchy-notification-wait treats its timeout argument as an attempt count: a crash can block the watcher for 3.5 minutes and then be dropped with no trace
omarchy-crash-watch calls omarchy-notification-wait before every toast (bin/omarchy-crash-watch:33). That helper's argument is documented as [timeout-seconds], but it is used as an attempt count, and each attempt is bounded only by omarchy-shell's own IPC timeout. The wait ends up ~21× longer than the parameter reads, it is taken synchronously inside the loop that consumes crashes, and it ends in a silent drop.
The arithmetic
bin/omarchy-notification-wait:
timeout=${1:-10}
attempts=$((timeout * 10))
while (( attempts > 0 )); do
if omarchy-shell notifications ping >/dev/null 2>&1 && notification_server_ready; then
exit 0
fi
attempts=$((attempts - 1))
sleep 0.1
done
exit 1
timeout * 10 iterations of sleep 0.1 equal timeout seconds only if each ping is instant. It isn't — bin/omarchy-shell wraps it:
ipc_timeout=${OMARCHY_SHELL_IPC_TIMEOUT:-2s}
output=$(timeout --kill-after=1s "$ipc_timeout" qs ipc -n -p "$OMARCHY_PATH/shell" call -- "$@" 2>/dev/null)
So when quickshell's IPC accepts but never answers, one attempt costs 2s, not ~0s.
Measured on omarchy 4.0.1-1 against a stub qs that accepts and never replies:
| call | documented as | measured |
|---|---|---|
omarchy-shell notifications ping |
— | 2.00 s |
omarchy-notification-wait 1 |
1 second | 21.03 s |
omarchy-notification-wait (default — how crash-watch calls it) |
10 seconds | 210.3 s (3.5 min) |
210.3 s = 100 attempts × (2.0 s + 0.1 s). If qs ignores SIGTERM, --kill-after=1s adds ~1 s per attempt, giving ~310 s.
Why it matters
announce() runs synchronously in the loop that reads crashes (bin/omarchy-crash-watch:85), so for those minutes the watcher consumes nothing.
The worst case is the case the wait was written for. The comment at line 29 is right that a shell crash takes the notification server down with it — but quickshell is not in the mute list at line 77 (only omarchy-crash-* and omarchy-agent-*), so a shell crash is itself announced, and that announcement is the one that enters the long wait. A shell that crashes and doesn't come straight back blocks the watcher for minutes, and every other crash in that window is missed.
The failure is also invisible:
omarchy-notification-waitwrites nothing to stderr; it justexit 1.- Line 33 is
omarchy-notification-wait || return 1— noelse, no log. - Line 85 is
announce ... && last_notified[$name]=$now— the false branch does nothing. - The unit stays
active.
The observable result: a process crashed, no toast appeared, nothing was written to any log, and systemctl --user is-active omarchy-crash-watch still says active. There's no way to tell afterwards that it happened.
Missed crashes aren't recoverable either — journalctl -f -n 0 (line 49) doesn't replay. The inotify rewrite in #7155 deliberately keeps that property ("core files already on disk are not replayed").
Reproduction
mkdir -p /tmp/stub && printf '#!/bin/bash\nsleep 30\n' > /tmp/stub/qs && chmod +x /tmp/stub/qs
time PATH=/tmp/stub:$PATH omarchy-notification-wait 1 # ~21s, not 1s
time PATH=/tmp/stub:$PATH omarchy-notification-wait # ~210s, not 10s
End to end: PATH-shadow omarchy-shell with a stub that stalls ~3 s inside a transient unit running the packaged omarchy-crash-watch, then induce a core dump. The journal entry reaches the watcher, no toast appears, the unit journal records nothing, and the unit stays active.
What this does not show
I haven't shown this is the cause of any particular missed notification in the wild — it's a mechanism reproducible on demand, not a diagnosis. Sampling the gate on an otherwise healthy machine (1440 samples over ~13.5 h) produced zero failures, with ping p50 16.4 ms against the 2 s budget and a max of 243 ms. On a healthy system the gate is nowhere near its limit. The concern is specifically the shell-down window — which is exactly when the gate is exercised, and exactly when it is slowest.
Suggested fixes
announce() and omarchy-notification-wait are untouched by #7155, so these apply either way.
-
Log the drop. One line turns a silent loss into something greppable:
omarchy-notification-wait || { echo "crash-watch: notification server unavailable, dropped crash for $comm" >&2 return 1 } -
Make the budget mean what it says — bound the helper by wall clock rather than attempt count, or document the argument as an attempt count:
deadline=$((SECONDS + timeout)) while (( SECONDS < deadline )); do -
Optionally, keep the announce wait off the consumer loop, so waiting for the shell to return doesn't stop the watcher reading later crashes.
Environment
- omarchy 4.0.1-1
- Reproduced against unmodified packaged
/usr/bin/omarchy-crash-watch,/usr/bin/omarchy-notification-wait,/usr/share/omarchy/bin/omarchy-shell systemd-coredumpwith the defaultStorage=external
Two PRs are open against this (#8872, #8881) — thank you both. There's one gap that applies to both fixes, which I missed in the original report:
A wall-clock deadline bounds the loop, but not a single iteration — and one call inside the loop is still unbounded.
notification_server_ready() runs busctl --user call … GetServerInformation with no --timeout. From busctl(1):
When not specified or when set to 0, the default of "25s" is assumed for the call command
So that call can block for up to 25s. The two halves of the probe fail differently:
- ping half — bounded by
omarchy-shell'stimeout --kill-after=1s ${OMARCHY_SHELL_IPC_TIMEOUT:-2s}. #8881 tightening this to0.5sis a good move. - busctl half — unbounded in source; 25s by default.
Since while (( SECONDS < deadline )) is evaluated between iterations, an iteration entered just under the deadline can still overshoot it by up to 25s. And that branch is reached precisely when the ping succeeds (ping && notification_server_ready) — i.e. the shell is up enough to answer IPC but its notification server isn't replying yet. That's a plausible mid-restart state, which is exactly when this helper runs.
Suggested addition to either PR:
busctl --user --timeout=1s call \
org.freedesktop.Notifications \
/org/freedesktop/Notifications \
org.freedesktop.Notifications \
GetServerInformation >/dev/null 2>&1
One clarification on the original numbers, so nobody over-reads them: 210s is the wedged-but-accepting case — IPC accepts the connection and never answers, which is what my stub reproduced. If quickshell is simply down, qs fails at connect almost immediately and the same call costs roughly 10–20s, not 210s. The pathological figure needs a shell that is up enough to accept and not up enough to answer.
@MeGaurav4 — re your question: yes, the caller-side log seems worth having. #8881 already includes one, so it's mostly a question of which PR carries it.
Checked against the current tip of quattro (c352b62), by reading the source; nothing was run for this issue itself. The mechanism is confirmed: bin/omarchy-notification-wait turns its [timeout-seconds] argument into timeout * 10 attempts and never deducts the time each probe takes, so with the default of 10 and a shell whose IPC accepts but never answers, the wait runs about 210 seconds instead of 10. The busctl probe has no --timeout either, so once the IPC ping succeeds a single iteration can still run past any deadline by busctl's default 25 seconds, as your follow-up says. omarchy-crash-watch calls it synchronously in announce() and returns on failure with nothing logged.
One correction to the impact: crashes that arrive during the wait are not lost. journalctl -f is piped into the loop, so their entries wait in the pipe and are read once the wait ends. Each then goes through its own wait, so while the shell stays wedged they are delayed and, if it never answers, each is dropped in turn, silently. The same helper is also called by omarchy-migrate-notify and omarchy-provision-first-run, both with the default timeout, so the fix reaches those too.
Two open pull requests fix this and both already close this issue: #8872, which bounds the helper by wall clock, and #8881, which does the same and also logs the dropped crash and adds a test. Each is reviewed and run on a worker as its own item, including whether it bounds the busctl call. Which one lands is the maintainer's decision, so this issue waits on them.
Second opinion: Codex at medium effort read the same source and confirmed the mechanism; the point about buffered crashes and the two other callers came from that review and was checked against the source.