From 50a5a48ed4bc819e8fdc46292520ea13a5824021 Mon Sep 17 00:00:00 2001 From: poprhythm Date: Tue, 25 Aug 2026 22:06:43 +0000 Subject: [PATCH] Fix false-positive stale-mount detection in nfs-mount-heal.sh find -maxdepth 3 couldn't reach immich's thumbs//XX/YY/file (4 levels deep), so it exhausted the 256x256 hash-bucket fan-out with no match and timed out on every run -- 3 spurious remounts/restarts of immich_server within 15 minutes of deploy, all falsely alerted as staleness. Drop -maxdepth entirely; -quit already stops at the first match via depth-first search, so it's fast regardless of tree depth. --- system-config/nfs-self-heal/nfs-mount-heal.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 }