A modern, delicious implementation of the Nix package manager, focused on correctness, usability, and growth — and committed to doing right by its community
Find a file
Jake Waksbaum 01db455733 Fix deadlock in nix-store when max-connections=1
This fixes a bug I encountered where `nix-store -qR` will deadlock when
the `--include-outputs` flag is passed and `max-connections=1`.

The deadlock occurs because `RemoteStore::queryDerivationOutputs` takes
the only connection from the connection pool and uses it to check the
daemon version. If the version is new enough, it calls
`Store::queryDerivationOutputs`, which eventually calls
`RemoteStore::queryPartialDerivationOutputMap`, where we take another
connection from the connection pool to check the version again. Because
we still haven't released the connection from the caller, this waits for
a connection to be available, causing a deadlock.

This diff solves the issue by using `getProtocol` to check the protocol
version in the caller `RemoteStore::queryDerivationOutputs`, which
immediately frees the connection back to the pool before returning the
protocol version. That way we've already freed the connection by the
time we call `RemoteStore::queryPartialDerivationOutputMap`.
2020-11-16 02:35:50 -05:00
.github Bump cachix/install-nix-action from v11 to v12 (#4237) 2020-11-09 23:21:55 +00:00
config
contrib
corepkgs
doc/manual docs: consistent console prompt (#4213) 2020-11-02 16:32:05 +01:00
m4
maintainers
misc Add some missing clean-files 2020-10-18 20:32:59 +02:00
mk
nix-rust
perl
scripts enable Darwin.arm64 to install x86_64 binary 2020-11-10 08:48:49 -06:00
src Fix deadlock in nix-store when max-connections=1 2020-11-16 02:35:50 -05:00
tests Add test case for incidentally fixed #4228 2020-11-09 22:43:14 +01:00
.dir-locals.el
.editorconfig
.gitignore
.version Revert "Bump version to 3.0" 2020-10-26 11:30:18 +01:00
bootstrap.sh
configure.ac
COPYING
default.nix
flake.lock flake.lock: Update 2020-10-18 21:20:35 +02:00
flake.nix No x86_32 static nix jobs for now 2020-10-28 05:13:18 +00:00
local.mk
Makefile
Makefile.config.in
precompiled-headers.h
README.md
shell.nix

Nix

Open Collective supporters Test

Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Please refer to the Nix manual for more details.

Installation

On Linux and macOS the easiest way to install Nix is to run the following shell command (as a user other than root):

$ curl -L https://nixos.org/nix/install | sh

Information on additional installation methods is available on the Nix download page.

Building And Developing

See our Hacking guide in our manual for instruction on how to build nix from source with nix-build or how to get a development environment.

Additional Resources

License

Nix is released under the LGPL v2.1.