Conversation
When the shell's event loop is wedged (e.g. after WirePlumber restarts leave Quickshell spinning on a dead PipeWire socket), `quickshell kill` cannot reach the instance over its ipc.sock. The restart command would then report failure and leave the old process running and leaking. After the IPC kill loop: - Collect quickshell pids that are still running this config from /proc - Send SIGTERM, wait briefly, then SIGKILL for any survivors - Clean up stale quickshell runtime directories (dead by-pid entries and dangling by-shell symlinks) so a replacement can register even if the tmpfs was filled by a spinning shell. Fixes omacom#12641. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Two source-level correctness issues remain in the recovery path at Verified by source inspection: the existing IPC stop loop is preserved, with TERM/KILL escalation added for matching processes that remain. Native recovery was not verified. Wait for termination before deciding which runtime directories are staleThe SIGKILL loop and cleanup have no intervening completion check. Sending SIGKILL does not wait for termination or parent reaping; an exiting or unreaped process can still pass Impact: If that directory contains the log filling runtime tmpfs, this recovery attempt can leave those bytes unreclaimed. This is timing-dependent; actual tmpfs-full recovery and native Quickshell registration were not tested. Suggested change: Confirm the targeted process has exited and coordinate reaping as needed, then clean its stale runtime entry before launching the replacement. Use a bounded failure path if termination cannot be confirmed, rather than assuming signal delivery completes it. Match the config argument exactly before signallingThe process filter flattens NUL-separated argv and searches for Synthetic path example, directly implied by the predicate:
Impact: A routine restart can terminate a separate Quickshell configuration whose path merely contains the requested path. The same false match can occur in an unrelated argument. Suggested change: Parse NUL-separated arguments and compare the actual config-path option precisely, accounting for supported option forms and path normalization, before selecting signal targets. Review informationTest scope: Source inspection of both revisions, the launcher and tests. These findings rely on source control flow and Linux signal semantics, not a native desktop reproduction. The new recovery test checks syntax and source patterns, not these behaviors. Real Quickshell, locked-session recovery and tmpfs exhaustion remain untested. Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review. Automated AI review: GPT 6 Astra Medium performed initial inspection and synthesis; Opus 5.5 High and GPT 6 Sol Xhigh completed independent technical assessments. Claims were checked against the pinned source, followed by a fresh Astra Medium editorial check. |
Review feedback identified two correctness issues in the signal fallback: - The /proc/<pid>/cmdline substring match could catch a different Quickshell config whose path merely contained the requested one. Parse argv and compare the -p/--path argument exactly instead. - Sending SIGKILL does not wait for the process to be reaped; a zombie can still pass kill -0. Use /proc/<pid>/stat state Z (or a missing process) to determine real death before removing runtime directories. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Automated AI review
Follow-up at
Verified by source inspection:
Signal fallback cannot find a shell relaunched by Quickshell's crash handlerIn Quickshell v0.3.1, a shell that crashes at least 10 seconds after launch is relaunched in place: the original process calls If that relaunched shell later stops servicing IPC, Impact: The wedged-shell recovery this PR adds does not apply to the default Omarchy shell after a qualifying crash relaunch, which is the state the lock-check comment describes. Frequency is unknown. Suggested change: Also select target PIDs from Quickshell's own instance registry, which does not need the wedged IPC socket, for example Review informationTest scope: Source inspection of AI process: Opus 5.5 Medium coordination and synthesis; independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, with a targeted follow-up question on the crash-relaunch path; Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
Fixes #12641.
omarchy restart shellcould not recover a shell whose IPC socket was wedged.quickshell killtalks to the instance overipc.sock; if the shell's event loop is stuck (e.g. after a WirePlumber restart leaves Quickshell spinning on a dead PipeWire socket), the kill never lands and the command immediately reported failure while the old process kept running and leaking.Changes:
quickshellprocesses still running this config from/proc/<pid>/cmdlineSIGTERMtoSIGKILLfor survivorsby-pidentries and danglingby-shellsymlinks. This matters because a spinning shell can fill/run/user/$UID, and onceinstance.lockcannot be written,qs list/qs ipccannot match the fresh instance even after the old process is gone.Tested:
bash -n bin/omarchy-restart-shelltest/shell.d/restart-shell-recovery-test.shvalidates the IPC kill loop, signal fallback, and cleanup logicGenerated with Devin