This repository was archived by the owner on Jul 2, 2026. It is now read-only.
Commit b91ac1f
committed
fix(download): stage+rename archive extracts to avoid ETXTBSY races
Concurrent prek invocations of the same hook (oxlint, shellcheck, hadolint,
etc.) used to share a single extraction target inside the cache dir. While
one wrapper was still writing the binary via tar -xzf, another's exec on the
same path returned 'Text file busy' (ETXTBSY) and the hook failed with
exit 126 on aarch64 CI runners.
Extract into mktemp -d staging instead, chmod there, and atomic-rename the
single binary into bin_path. The rename is a directory-entry swap, so any
process mid-exec on the old inode is unaffected and no writer ever holds
bin_path open.1 parent 7b6c61b commit b91ac1f
2 files changed
Lines changed: 23 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
171 | 177 | | |
172 | 178 | | |
173 | | - | |
| 179 | + | |
174 | 180 | | |
175 | 181 | | |
176 | | - | |
| 182 | + | |
177 | 183 | | |
178 | 184 | | |
| 185 | + | |
179 | 186 | | |
180 | 187 | | |
181 | 188 | | |
182 | 189 | | |
183 | 190 | | |
184 | 191 | | |
185 | 192 | | |
186 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
187 | 199 | | |
188 | 200 | | |
189 | 201 | | |
0 commit comments