Vivarium · Layer 2 · Docker (catalogue)

Linux flock(2) is advisory only

A program holding an exclusive flock on a file does not stop cat, cp, grep, or any other tool that doesn't itself call flock from reading or writing the file. Linux file locks are advisory: only programs that opt in see the lock. Many developers misunderstand this; the page lets you confirm the surprise end-to-end.

CI verdict snapshot

Loading verdict snapshot…

Reproduce yourself

docker run --rm ghcr.io/aletheia-works/vivarium-flock-is-advisory:latest

First-pull cost ~10 MB (alpine:3.19 + util-linux). Run takes ~2.5 s. See the recipe directory for the Dockerfile and repro.sh.

CI snapshot output

(loading…)