aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-10-04 15:03:03 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-08-02 18:39:16 +0200
commite349f2c0a370e4dfd09ae51c2cae4db08a834ad5 (patch)
tree5eed56eba53bbeae7b06beec4e021c3922b64528 /src/libstore/build.cc
parentec415d7166d607c92cf8f1af688f86e4b4731dff (diff)
Use BSD instead of POSIX file locks
POSIX file locks are essentially incompatible with multithreading. BSD locks have much saner semantics. We need this now that there can be multiple concurrent LocalStore::buildPaths() invocations.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index cf6428e12..a28619ab9 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -3984,17 +3984,6 @@ void SubstitutionGoal::tryToRun()
return;
}
- /* If the store path is already locked (probably by a
- DerivationGoal), then put this goal to sleep. Note: we don't
- acquire a lock here since that breaks addToStore(), so below we
- handle an AlreadyLocked exception from addToStore(). The check
- here is just an optimisation to prevent having to redo a
- download due to a locked path. */
- if (pathIsLockedByMe(worker.store.toRealPath(storePath))) {
- worker.waitForAWhile(shared_from_this());
- return;
- }
-
maintainRunningSubstitutions = std::make_unique<MaintainCount<uint64_t>>(worker.runningSubstitutions);
worker.updateProgress();
@@ -4034,12 +4023,6 @@ void SubstitutionGoal::finished()
try {
promise.get_future().get();
- } catch (AlreadyLocked & e) {
- /* Probably a DerivationGoal is already building this store
- path. Sleep for a while and try again. */
- state = &SubstitutionGoal::init;
- worker.waitForAWhile(shared_from_this());
- return;
} catch (std::exception & e) {
printError(e.what());