#16524·nix

Define the behavior of `findGenerations` with concurrent profile modifications

Author: xokdviumCreated Sep 26, 2026Updated Sep 26, 2026

See https://github.com/NixOS/nix/pull/16523.

Basically, we are inconsistent about profile locking when reading the profile. Acquiring a lock is detrimental because that requires write access, which shouldn't be needed so this is no longer done.

The existing code is probably not very reliable under concurrent modifications.

TODO:

  • Agree on the API contract that we should enforce here.
  • Add tests exercising writes concurrent with reads. Maybe ionotify the catch exact timing?

Originally posted by @xokdvium in https://github.com/NixOS/nix/issues/16523#issuecomment-5845713008