advisory-file-lock · shipping · also advisory locking

Advisory file lock

An advisory file lock coordinates access among cooperating participants without itself preventing access that bypasses the locking protocol.

Related Observatory article: Read on hesela.com

On local Linux filesystems, flock() locks follow open file descriptions; a replacement pathname can refer to a different file. Hesela's ordered subprocess observation acquires a second lock after target replacement while the old file remains locked. Retaining a separate coordination file preserves the tested conflict; deleting and recreating it loses that shared identity. [1] [2]

A conflicting nonblocking shared-to-exclusive flock conversion can discard the caller's earlier protection. In Hesela's ordered local-Linux experiment, a cooperating writer changed the same file before the caller reacquired; F_SETLK and F_OFD_SETLK retained exclusion in corresponding controls. Reacquisition does not validate an earlier read. The 72 executions used one kernel, not 72 independent systems. [1] [4]

The downloadable packet contains native C code, Python replay, raw traces, source receipts and checksums. This is not a crash, NFS/SMB or failure-rate experiment. [5]

Relations

related
Open-file-description lock, Open file description, Atomic rename, Unlink, Process-associated record lock, flock

Limitations

  • A lock does not substitute for file or directory synchronization. [3]
  • NFS and SMB/CIFS can change flock interaction and enforcement; this local experiment does not test them. [1]
  • All participants must coordinate on the same stable file using compatible locking operations. [3]

Citations

  1. Linux man-pages 6.19: flock(2), ownership and filesystem differences (accessed 2026-11-09)
  2. Hesela: local Linux lock-identity observation, source hash and limitations (accessed 2026-10-16)
  3. Hesela: A lock follows the opened file, not the replacement name (accessed 2026-10-16)
  4. Hesela: 72 ordered local-Linux lock-conversion observations, one kernel (accessed 2026-11-09)
  5. Hesela: frozen lock-conversion code, raw observations and offline replay (accessed 2026-11-09)

JSON: /data/terms/advisory-file-lock.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Advisory file lock. Hesela. 2026-11-14. https://hesela.dev/terms/advisory-file-lock/