Repository navigation
Retry the ESP unmount in boot-to-esp and name what holds it - #785
joshuaswarren wants to merge 2 commits into
Conversation
[Medium impact] The PR appears safe to merge; the remaining test gap is non-blocking. Findings
SummaryAdds
Reviews (3) · Last reviewed commit: "Test that a busy ESP prints no restore i..." · Reviewed by Greptile |
| if output=$(busy_for=99 unmount_run 2>&1); then | ||
| fail 'an ESP that stays busy stops the move' | ||
| fi | ||
| [[ $output == *'target is busy'* && $output == *'udisksd'* && $output == *'nothing has been moved'* ]] || | ||
| fail 'a busy ESP names its holders and says nothing was moved' "$output" |
There was a problem hiding this comment.
Wrong restore instructions go unchecked
The new busy-ESP tests call unmount_esp directly, without the ERR trap installed by main, and only check for expected text. They would still pass if the failure also printed the incorrect /boot.old restore instructions—the other regression this PR intends to fix. Add a test with the trap installed and assert that the recovery instructions are absent.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Greptile on omacom#785: the busy-ESP tests called unmount_esp without the ERR trap main installs, so they would pass even if the failure printed the /boot.old restore instructions for a move that never started. Add a case with trap recovery_note ERR installed that asserts those instructions are absent.
|
[Joshua's agent] Greptile's P2 addressed in |
Step 1 of omarchy-mac-setup aborted with "umount: /boot/efi: target is busy" (omacom#776). The unmount is now retried a few times, and if the ESP stays busy the script stops with fuser output and says nothing has been moved, instead of printing the restore instructions for a move that never started. Tests: a briefly busy ESP is unmounted on the third call; an ESP that stays busy stops the move and names its holders.
Greptile on omacom#785: the busy-ESP tests called unmount_esp without the ERR trap main installs, so they would pass even if the failure printed the /boot.old restore instructions for a move that never started. Add a case with trap recovery_note ERR installed that asserts those instructions are absent.
1fea829 to
95d8ab8
Compare
Still needed: [Joshua's agent] |
|
GREEN at 95d8ab8 [Joshua's agent] Reviewed the unmount helper, its single main caller, failure/trap behavior and added regression cases. The helper retries ordinary unmount only; it adds no force/lazy unmount or process killing. Persistent failure reports the last error and best-effort holder diagnostics, then exits before copying/moving boot files or rewriting fstab. Its explicit fail exits without printing recovery instructions for a move that never started; the later migration recovery trap remains in place. The focused shell test passes all 14 checks, including existing boot-layout refusal cases, third-attempt success, permanent-busy refusal/holder output and absence of inappropriate /boot.old restore instructions. Shell syntax passes. No blocking findings. Limits: no real ESP unmount, boot-file move, filesystem change or hardware test. This is a bounded retry for transient contention, not proof of the original holder's identity or a root-cause fix for persistent contention. fuser diagnostics are best-effort; the safe failure does not depend on their success. Reviewer: Codex GPT-6.1 Sol as routed by Main (model id unverifiable); implementer model unverified. |
Refs #776.
omarchy-system-boot-to-espruns a bareumount /boot/efi. When something holds the ESP for a moment, setup step 1 aborts withumount: /boot/efi: target is busy., and the ERR trap then prints the restore instructions for a move that has not started (mv /boot.old /boot, which does not exist yet).Change:
unmount_espretries the unmount up to five times, two seconds apart. If the ESP stays busy it stops with the umount error andfuser -vmoutput, and says nothing has been moved.maincalls it in place of the bareumount.Tests (
test/shell.d/boot-to-esp-test.sh), written first: before the change the new cases fail withunmount_esp: command not found. After: a briefly busy ESP is unmounted on the third call; an ESP that stays busy stops the move and names its holders.Not verified: what held the mount in #776 (the reporter did not capture
fuser), so the retry is a mitigation for a transient holder, not a proven cure. If it stays busy, the new output names the holder for the next report. I have no Mac to run this on; the checks are the shell tests withumount,sleepandfuserstubbed.test/shell.d/boot-to-esp-test.shpasses; I ran the widertest/shellsuite up to its time limit and did not see it finish, so CI is the full run.Note on the issue text: the reporter says fstab had already been updated, but in this script the unmount comes before any change, so that part does not match the code and I could not explain it.