Repository navigation
Conversation
A shell busy enough to outlast the 5s kill timeout ended the kill loop while still alive. The replacement then exited at once as a duplicate, and the readiness ping could be answered by the dying shell, so omarchy restart shell reported success and left no shell running. Wait until quickshell lists no instance, force any that outlast a 5s grace period, and refuse to launch if one still won't exit.
Automated AI review
Verified: the new wait loop fixes the reported case, a shell that exits cleanly but takes longer than the 5 s kill timeout. Two issues remain on the new SIGKILL path: the old shell's supervisor relaunches it, and the PID passed to
Verified:
A force-killed shell is relaunched by its old supervisorIn a session the shell runs under Timeline from a synthetic Quickshell, driven by the production head Impact: this affects only the escalation the PR adds, a shell still alive about 9-10 s into the restart. With a fast startup the only effect is a misleading crash-style journal entry. If startup between the check and the lock takes longer than about 0.9 s, two shells run the same config, and the restart still reports success: its readiness ping only checks that some shell answers. How long real Quickshell takes at that point was not measured. A third ordering is possible by source: the old supervisor wins, the fresh launcher is refused, and the shell keeps running under the old supervisor. Suggested change: stop the old supervisor before forcing its shell. Its Optional test improvement: the new test's stubborn shell is a bare An unreadable instance record turns into
|
omarchy-launch-shell treats a SIGKILLed shell as a crash and relaunches it after a one-second backoff, racing the replacement restart has just dispatched: two launchers, and with a slow enough startup two shells. TERM the supervisor first; its stop trap forwards the signal and exits without relaunching. quickshell list reports pid 0 for an instance whose lock data it cannot read, and kill -KILL 0 signals the restart's own process group, which under omarchy-update includes the update. Only positive pids are forced; an unforceable instance still counts as lingering, so restart gives up with its message rather than launching a duplicate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| # restart reports success and leaves no shell at all. So wait until no | ||
| # instance is listed, and force any that outlast a grace period. | ||
| shell_instance_pids() { | ||
| quickshell list -p "$CONFIG_DIR" --any-display -j 2>/dev/null | jq -r '.[]?.pid' 2>/dev/null |
There was a problem hiding this comment.
If the instance query fails or returns unreadable JSON, shell_instance_pids produces no PIDs. The caller treats that as proof that the old shell has exited. After the kill command times out, this can launch the replacement too early, bringing back the duplicate-launch race and leaving the user without a bar.
Distinguish a confirmed empty list from a failed query, and report the latter instead of launching.
|
Reviewed and tested on a disposable Omarchy VM. The bug is real and this fixes it: when the old shell takes more than 5 s to exit, I pushed two commits to your branch:
On the worker, Greptile's point that a failed Other open pull requests fix the same bug: #11015 waits up to 30 s but then launches anyway, and also carries a separate Bar.qml performance change. #11014 retries the launch, but stops retrying once the dying old shell answers the readiness ping. #7546 stops the supervisors, but gives up after 5 s and launches nothing. This one is the smallest of them and the only one that both waits for the old shell to exit and refuses to launch a duplicate when it won't. #12983 overlaps on the signal fallback, but it addresses a wedged IPC socket (#12641), which is a different bug. Second opinion: Codex at medium effort compared all of these and reviewed the final head. It found no defect, and agreed that this pull request is the one to keep. Its independence from this review isn't guaranteed. This now waits on the maintainer. |
|
Closing this alternative after #11015 merged into Scope checked by GPT-6 in Codex and Codex Medium against the discussion and landed change; review independence is not guaranteed. No tests were rerun for this cleanup. Omabot on behalf of DHH |
Problem
omarchy restart shellcan report success and leave no shell running (no bar).The kill loop runs
timeout 5 quickshell kill …. When the shell is busy enough to take longer than 5 s to exit,timeoutends the command, the loop reads that as "no instances left", and the replacement is launched while the old shell is still alive. The newquickshell -nexits at once as a duplicate ("An instance of this configuration is already running."), whichomarchy-launch-shelltreats as a deliberate stop. The readiness ping can then be answered by the still-dying old shell, so restart exits 0 just before that shell goes away.I hit this during a plugin stress test; the journal showed the new instance refusing as a duplicate 5 s before the old one logged "Exiting due to IPC request".
Reproduce
Fix
After the kill loop, wait until
quickshell listreports no instance for the config. Anything still alive after a 5 s grace period getsSIGKILL; if an instance still won't go after 10 s, restart refuses to launch a duplicate and says so instead of claiming success.Testing
test/shell.d/restart-shell-test.sh: the fakequickshelllearnslistand a stubborn mode wherekilltimes out with the instance alive. The new case fails onquattro("restart forces a shell that will not exit") and passes with this change; the existing cases still pass../test/all: the only failures are 5 that fail identically on unchangedquattroon my machine (missingomarchy-pkgscheckout, VS Code theme, kernel headers), unrelated to this change.Fixes #14085
Fixes #14013