Commit 08fdf06
committed
osdc/hf-cache: fix prepare-host-mount init crash-loop on shadowed /mnt/hf_cache
#876's self-heal init can crash-loop instead of healing, leaving the cache
mount silently absent on a node whose startup taint is already cleared — so
CI jobs land on the node and read an empty /mnt/hf_cache (observed on 20 ue2
nodes, 29 job pods, incl. a failed pytorch inductor job).
Root cause, all in the prepare-host-mount init:
- `mount --bind /mnt /mnt` is non-recursive, so re-binding /mnt shadows a
pre-existing /mnt/hf_cache submount (e.g. one left by an earlier init
version that bound /mnt/hf_cache directly on the root fs).
- the guard `grep -q " /mnt/hf_cache " /proc/mounts` matches that shadowed,
now-unreachable mount, so the re-bind is skipped.
- `mount --make-rshared /mnt/hf_cache` then runs on a live path that is not
a mountpoint -> "not mount point or bad option" -> `set -e` -> the init
exits non-zero and CrashLoopBackOffs forever (80+ restarts seen).
Fix:
- guard on the LIVE path with `mountpoint -q`, never a /proc/mounts scan, so
a shadowed orphan can't make us skip the bind.
- use `mount --rbind` for /mnt so an existing submount is carried into the
new bind instead of being shadowed.
- tolerate `make-rshared` failures (|| true) so a transient state can't turn
into a crash-loop.
- peel any occupant of the live /mnt/hf_cache (dead FUSE or stale xfs bind)
with a bounded loop, not one gated on `stat` (a stale bind stats fine).
just lint + just test pass. Smoke test's `make-rshared` assertion still holds.1 parent 494edf2 commit 08fdf06
1 file changed
Lines changed: 36 additions & 18 deletions
Lines changed: 36 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
87 | 106 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
95 | 113 | | |
96 | 114 | | |
97 | 115 | | |
| |||
0 commit comments