fix(loader): stage prepared images in per-writer files

write_if_changed used a shared <hash>.tmp file, so two concurrent cold launches of the same image could truncate each other's staging bytes or fail the rename after the other had published. Move publication into a portable module that stages under a unique pid/sequence name and removes it on failure. Two hermetic tests cover concurrent publishers and a failed rename.

(cherry picked from commit 1aac20aa8fd97237053c985b942225d54c0194a7)
This commit is contained in:
quaternion authored and local committed 2026-11-25 01:03:00 -06:00
1 parent e7b97d9bf6
commit b0f38b4a0c
3 files changed
+79 -7

No files matched your search

+1
View File
@@ -25,6 +25,7 @@
mod console_insn;
mod crash;
pub mod prepare;
pub(crate) mod publish;
pub mod resolve;
#[cfg(all(windows, feature = "diagnostics"))]
mod stacks;