Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
base: 399c7f3f8bab
Choose a base ref
...
head repository: NixOS/nix
compare: 0d6419ad87f5
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 16, 2020

  1. 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`.
    jbaum98 committed Nov 16, 2020
    Copy the full SHA
    01db455 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #4262 from jbaum98/master

    Fix deadlock in nix-store when max-connections=1
    edolstra committed Nov 16, 2020
    Copy the full SHA
    0d6419a View commit details
    Browse the repository at this point in the history