diff --git a/system-config/nfs-self-heal/nfs-mount-heal.sh b/system-config/nfs-self-heal/nfs-mount-heal.sh index 0dd6de3..037aaa8 100644 --- a/system-config/nfs-self-heal/nfs-mount-heal.sh +++ b/system-config/nfs-self-heal/nfs-mount-heal.sh @@ -30,7 +30,13 @@ alert() { healthy() { local testdir="$1" local f - f=$(timeout 10 find "$testdir" -maxdepth 3 -type f -print -quit 2>/dev/null) || return 1 + # No -maxdepth: -quit stops at the first match via depth-first search, + # so this is fast regardless of tree depth. A maxdepth that's too + # shallow for the actual file depth (e.g. immich's thumbs//XX/YY/ + # file is 4 levels deep) makes find exhaust a huge fan-out with no + # match and time out -- a false positive, not real staleness (hit in + # production 2026-08-25, 3 spurious remounts in 15 min). + f=$(timeout 10 find "$testdir" -type f -print -quit 2>/dev/null) || return 1 [ -n "$f" ] || return 1 timeout 10 cat "$f" > /dev/null 2>&1 }