about summary refs log tree commit diff
path: root/src/libstore/pathlocks.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-08-28T11·36+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-08-28T11·36+0000
commitc970b28ba0f8866bde800849120d429d781ccb5d (patch)
tree2df160bfab85deeac18a34494aa6e65482c88f83 /src/libstore/pathlocks.hh
parentbc0429b1cd94289ac8d8a51f562b920999002b89 (diff)
* Fix a race condition with parallel builds where multiple
  fixed-output derivations or substitutions try to build the same
  store path at the same time.  Locking generally catches this, but
  not between multiple goals in the same process.  This happened
  especially often (actually, only) in the build farm with fetchurl
  downloads of the same file being executed on multiple machines and
  then copied back to the main machine where they would clobber each
  other (NIXBF-13).

  Solution: if a goal notices that the output path is already locked,
  then go to sleep until another goal finishes (hopefully the one
  locking the path) and try again.

Diffstat (limited to 'src/libstore/pathlocks.hh')
-rw-r--r--src/libstore/pathlocks.hh3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstore/pathlocks.hh b/src/libstore/pathlocks.hh
index 87bb7bf3ef71..0ca1ce687849 100644
--- a/src/libstore/pathlocks.hh
+++ b/src/libstore/pathlocks.hh
@@ -40,6 +40,9 @@ public:
 };
 
 
+bool pathIsLockedByMe(const Path & path);
+
+
 }