craft-cloud-local: README qualifies the same-process save guarantee

Two saves made from the same etag in one process can both succeed when
the first save leaves the file with an unchanged etag. The Concurrent
saves section now says so and points at the paragraph that explains it.
This commit is contained in:
dotCooCoo committed 2026-11-23 23:48:08 -08:00
1 parent 7dd2394aa0
commit 2e80b6722d
1 file changed
+5 -5
+5 -5
View File
@@ -41,11 +41,11 @@ inside the root or out, that happens to point at the same inode.
## Concurrent saves
A `Job::Write` checks the file's etag again just before the rename, and holds one lock for this
process from that check until the rename is done. Within one process, two saves made from the
same etag cannot both succeed: the second gets `Fault::Conflict`. A second process writing the
same folder does not take that lock, so its save can still land between the check and the rename.
A deployment that needs the guarantee across processes needs a backend whose provider offers a
conditional write.
process from that check until the rename is done. Within one process, when two saves are made
from the same etag, the second gets `Fault::Conflict`, unless the first save left the file with an
unchanged etag (see the next paragraph). A second process writing the same folder does not take
that lock, so its save can still land between the check and the rename. A deployment that needs
the guarantee across processes needs a backend whose provider offers a conditional write.
The etag is the file's length and modification time. On a filesystem whose timestamps are coarser
than the time between two saves, two saves of the same length can leave the same etag, and the