1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 11:03:54 +02:00

LocalStore::addTempRoot(): Handle ENOENT

If the garbage collector has acquired the global GC lock, but hasn't
created the GC socket yet, then a client attempting to connect would
get ENOENT. Note that this only happens when the GC runs for the first
time on a machine. Subsequently clients will get ECONNREFUSED which
was already handled.

Fixes #7370.
This commit is contained in:
Eelco Dolstra 2023-06-19 16:54:05 +02:00
parent f5e620bf2b
commit c5fdbdae32
2 changed files with 15 additions and 5 deletions

View file

@ -9,16 +9,21 @@ clearStore
fifo=$TEST_ROOT/test.fifo
mkfifo "$fifo"
fifo2=$TEST_ROOT/test2.fifo
mkfifo "$fifo2"
dummy=$(nix store add-path ./simple.nix)
running=$TEST_ROOT/running
touch $running
(_NIX_TEST_GC_SYNC=$fifo nix-store --gc -vvvvv; rm $running) &
(_NIX_TEST_GC_SYNC=$fifo _NIX_TEST_GC_SYNC_2=$fifo2 nix-store --gc -vvvvv; rm $running) &
pid=$!
sleep 2
(sleep 1; echo > $fifo2) &
outPath=$(nix-build --max-silent-time 60 -o "$TEST_ROOT/result" -E "
with import ./config.nix;
mkDerivation {