lix/src
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
..
build-remote Remove static variable name clashes 2020-10-06 13:49:20 +02:00
cpptoml Revert the enum struct change 2020-06-18 22:11:26 +00:00
libexpr Fix default nix-path 2020-11-12 15:46:08 +00:00
libfetchers Fix use of dirty Git/Mercurial inputs with chroot stores 2020-11-10 23:22:45 +01:00
libmain Fix assertion failure in tab completion for --option 2020-10-29 18:26:35 +01:00
libstore Fix deadlock in nix-store when max-connections=1 2020-11-16 02:35:50 -05:00
libutil Fix stack overflow introduced in #4206 2020-11-10 04:25:24 +01:00
nix nix develop: Preserve stdin with -c 2020-11-09 22:43:14 +01:00
nix-build Split out local-fs-store.hh 2020-10-09 20:18:08 +00:00
nix-channel Remove static variable name clashes 2020-10-06 13:49:20 +02:00
nix-collect-garbage Remove static variable name clashes 2020-10-06 13:49:20 +02:00
nix-copy-closure Remove static variable name clashes 2020-10-06 13:49:20 +02:00
nix-daemon Remove static variable name clashes 2020-10-06 13:49:20 +02:00
nix-env Split out local-fs-store.hh 2020-10-09 20:18:08 +00:00
nix-instantiate Split out local-fs-store.hh 2020-10-09 20:18:08 +00:00
nix-prefetch-url Remove static variable name clashes 2020-10-06 13:49:20 +02:00
nix-store LocalStore: Get rid of recursive_mutex 2020-11-03 14:45:24 +01:00
resolve-system-dependencies lstat() cleanup 2020-09-23 19:17:28 +02:00