Repository navigation
Conversation
4b1a245 to
39c872f
Compare
An IPC clean exit used to stop omarchy-launch-shell because restart-shell starts a replacement. When that replacement fails, the seat stays without a bar. Relaunch while Hyprland is alive unless the supervisor was signalled to stop, and have restart-shell stop the old supervisor before replacing it. Fixes omacom#10703
Clean exit while Hyprland lives is now relaunched. Keep proving a clean exit into a dead compositor still stops, and that TERM still wins.
39c872f to
bb279bd
Compare
|
Reviewed against The bug in #10703 is real: Quickshell's #11014 fixes the same symptom inside
Related: #7546 (draft) stops launchers before restarting, #8630 only waits longer, and #10634 coalesces concurrent restarts; the last two address different problems. Second opinion: Codex Medium was asked to choose among these without being given this conclusion. It also picked #11014 and named the same two pid-file defects; since it can read this session, its agreement is not guaranteed to be independent. #11014 currently conflicts with Which fix to take is the maintainer's call, so this waits on them. |
|
I fixed the two pid-file issues from the review in cfd6911.
I checked this with a local script. On the previous commit it removes the pid file and sends TERM to an unrelated process. With this commit both checks pass. If you prefer #11014 as the narrower fix, that is fine with me. |
|
| recorded_pid=$(cat "$pid_file" 2>/dev/null) | ||
| if [[ $recorded_pid =~ ^[0-9]+$ ]] && (( recorded_pid != $$ )) && | ||
| [[ $(tr '\0' ' ' 2>/dev/null <"/proc/$recorded_pid/cmdline") == *omarchy-launch-shell* ]]; then | ||
| exit 0 | ||
| fi | ||
| printf '%s\n' "$$" >"$pid_file" |
There was a problem hiding this comment.
Concurrent launches create duplicate supervisors
If two restarts launch supervisors while the PID file is absent, both can pass this check before either writes its PID. Both then start Quickshell, but only the last supervisor’s PID is recorded. A later restart stops only that supervisor, leaving the other free to relaunch a duplicate shell.
| if (( attempt == 19 )); then | ||
| launch_replacement |
There was a problem hiding this comment.
If the first replacement repeatedly exits immediately, its supervisor can still be alive at this retry. The second launcher then sees that supervisor’s PID and exits without starting a shell. Fast failed pings can finish before the first supervisor exhausts its relaunch budget; when it later gives up, no retry remains and the seat is left without a bar.
|
Re-reviewed at cfd6911 against cfd6911 does fix the two pid-file problems from the last review. A second launcher now leaves a live supervisor's record alone, and restart signals the recorded pid only while its command line is still Since then, #13141 has been tested on a disposable Omarchy VM and is labelled
#11014 retries the launch instead, but stops as soon as the dying shell answers the ping, and it conflicts with Second opinion: Codex Medium compared #10709, #11014, #13141, #11015 and #7546 without being told my conclusion. It also picked #13141 and found the three points above, which I checked against the source. Codex can read this session, so its agreement is not guaranteed to be independent. Choosing between competing fixes is up to the maintainer, so this is waiting on them. |
|
Looked at again at cfd6911, because the rule for choosing between competing fixes has changed: the oldest fix now wins by default, and a newer one only wins when the older misses a case, breaks something, or does not fix the cause. This one predates #13141, so it was compared again on that basis. The code was read on both branches against #13141 still wins, because of one case this change does not handle: an old shell that is slow to finish exiting.
#13141 waits until Two smaller points remain from the last review. Both the guard and Second opinion: Codex Medium was given all four fixes and the rule, but not this conclusion. It chose #13141 for the same reason and worked out the same timeline, which matches the source. It also found the two pid-file points. Codex can read this session, so its agreement is not guaranteed to be independent. The draft #7546 is older than this change, but it launches nothing if the old shell outlasts 5 s. #11014 stops retrying once the dying shell answers the ping. #13141 is already labelled |
Summary
Fixes #10703.
omarchy-launch-shelltreated every Quickshell exit 0 as a deliberate stop becauseomarchy-restart-shellstarts a replacement. When that replacement fails (IPC race, plugin reload storm, "already running"), the old supervisor is already gone and the seat stays without a bar until someone restarts by hand.Change
hyprctl -j monitors, unless the supervisor was signalled to stop.$XDG_RUNTIME_DIR/omarchy/launch-shell.pidso restart can stop the living supervisor before it relaunches the shell being replaced.omarchy-restart-shellstops that supervisor first, then kills Quickshell, then launches a replacement. If ping still fails halfway through the wait, it kicks a second launcher and keeps polling.Intentional stops still work: session teardown (compositor gone) and TERM/INT/HUP on the supervisor.
Test plan
test/shell.d/launch-shell-test.shfor the new clean-exit policy./test/shell.d/launch-shell-test.shon an Omarchy checkout./test/shell.d/restart-shell-test.shstill passesomarchy restart shellrecovers the bar; kill Quickshell with an IPC clean exit while Hyprland is up and confirm the supervisor brings it backI could not run the shell harness on this machine (no Omarchy tree / compositor). Happy to adjust if CI disagrees.