Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible deadlock caused by substitution, outputLocks #12117

Open
2 tasks
roberth opened this issue Dec 30, 2024 · 2 comments
Open
2 tasks

Possible deadlock caused by substitution, outputLocks #12117

roberth opened this issue Dec 30, 2024 · 2 comments
Labels
bug store Issues and pull requests concerning the Nix store

Comments

@roberth
Copy link
Member

roberth commented Dec 30, 2024

Describe the bug

Guix have fixed a deadlock, apparently caused by the substitution goal not releasing locks soon enough.

Steps To Reproduce

Expected behavior

Possible fix:

diff on guix:

diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index 43a8a371846..edd01bab34d 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -1200,6 +1200,7 @@ void DerivationGoal::tryToBuild()
     if (buildMode != bmCheck && validPaths.size() == drv.outputs.size()) {
         debug(format("skipping build of derivation `%1%', someone beat us to it") % drvPath);
         outputLocks.setDeletion(true);
+        outputLocks.unlock();
         done(BuildResult::AlreadyValid);
         return;
     }
@@ -3070,6 +3071,7 @@ void SubstitutionGoal::tryToRun()
     if (!repair && worker.store.isValidPath(storePath)) {
         debug(format("store path `%1%' has become valid") % storePath);
         outputLock->setDeletion(true);
+        outputLock.reset();
         amDone(ecSuccess);
         return;
     }

Metadata

Additional context

Checklist


Add 👍 to issues you find important.

@roberth roberth added bug store Issues and pull requests concerning the Nix store labels Dec 30, 2024
@roberth roberth added this to Nix team Dec 30, 2024
@github-project-automation github-project-automation bot moved this to To triage in Nix team Dec 30, 2024
@Mic92 Mic92 moved this from To triage to 🏁 Review in Nix team Jan 8, 2025
@Mic92
Copy link
Member

Mic92 commented Jan 8, 2025

#12160

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2025-01-08-nix-team-meeting-minutes-207/58523/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug store Issues and pull requests concerning the Nix store
Projects
Status: 🏁 Review
Development

No branches or pull requests

3 participants