feat: party clean removes the caller's own crash leftovers
Turns the manual rm -rf recovery from host's EEXIST message into a verb, behind the same gates cmd_close uses: own-basename glob, no symlinks, ownership check, and a dead socket. Live parties are skipped with a pointer to party close.
This commit is contained in:
parent
6799a57405
commit
a011e4b03c
6 changed files with 133 additions and 9 deletions
|
|
@ -564,7 +564,7 @@ STUB
|
|||
# deliberately do NOT auto-clean: the same code path triggers on a
|
||||
# concurrent in-flight host attempt for the same name, and racing
|
||||
# rm -rf calls would wipe each other's fresh dirs.
|
||||
# Recovery is a manual `rm -rf` per the error message.
|
||||
# Recovery is `party clean` per the error message.
|
||||
party_dir="$PARTY_SOCKET_DIR/party-$USER:resurrect.d"
|
||||
mkdir -p "$party_dir"
|
||||
: > "$party_dir/sock"
|
||||
|
|
@ -572,7 +572,7 @@ STUB
|
|||
run "$PARTY_BIN" host resurrect
|
||||
[ "$status" -ne 0 ]
|
||||
[[ "$output" == *"already exists"* ]]
|
||||
[[ "$output" == *"rm -rf $party_dir"* ]]
|
||||
[[ "$output" == *"party clean"* ]]
|
||||
|
||||
# The leftover dir is untouched — proves we did not race-clean.
|
||||
[ -d "$party_dir" ]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue