Commit d554197
Prevent concurrent LFS downloads from corrupting archives
Summary:
Sandcastle getdeps jobs lack LFS records for the CMake 3.31.12 macOS archive and fall back to racing external downloads. Adding those records moves the jobs to LFS, but concurrent getdeps callers can still request the same cached archive. With a shared `<filename>.part` staging path, the first successful `os.replace()` removes the source path while another caller still expects to publish it, causing that caller to fail and potentially fall back to the unreliable external source.
Give every download a random sibling staging path, create it exclusively with the normal umask-derived permissions, hash the payload while streaming, and atomically replace the target only after verification. Independent staging paths let concurrent downloads publish safely. Exclusive creation avoids clobbering a colliding path without introducing `mkstemp()`'s owner-only mode, while cleanup after a failed replace prevents random `.part` files from accumulating.
Point both CMake archive names at the existing content-addressed Manifold object so Darwin getdeps jobs use the stable cached archive.
Reviewed By: genevievehelsel, clara-9
Differential Revision: D114722621
fbshipit-source-id: b9b9d56266b15ac1db3b5ea976d23159c0bb18c81 parent c056a99 commit d554197
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments