aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/uds-remote-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-08-16 20:03:32 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-10-13 12:12:44 +0200
commit8614cf13344eca75074cd4af20fd90238571b0b6 (patch)
tree367c7d7a0d3a5bf7a38f6d18a0bc56e15ec0b057 /src/libstore/uds-remote-store.cc
parent9947f1646a26b339fff2e02b77798e9841fac7f0 (diff)
Non-blocking garbage collector
The garbage collector no longer blocks other processes from adding/building store paths or adding GC roots. To prevent the collector from deleting store paths just added by another process, processes need to connect to the garbage collector via a Unix domain socket to register new temporary roots.
Diffstat (limited to 'src/libstore/uds-remote-store.cc')
-rw-r--r--src/libstore/uds-remote-store.cc9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/libstore/uds-remote-store.cc b/src/libstore/uds-remote-store.cc
index 02e81b022..5c38323cd 100644
--- a/src/libstore/uds-remote-store.cc
+++ b/src/libstore/uds-remote-store.cc
@@ -56,14 +56,7 @@ ref<RemoteStore::Connection> UDSRemoteStore::openConnection()
auto conn = make_ref<Connection>();
/* Connect to a daemon that does the privileged work for us. */
- conn->fd = socket(PF_UNIX, SOCK_STREAM
- #ifdef SOCK_CLOEXEC
- | SOCK_CLOEXEC
- #endif
- , 0);
- if (!conn->fd)
- throw SysError("cannot create Unix domain socket");
- closeOnExec(conn->fd.get());
+ conn->fd = createUnixDomainSocket();
nix::connect(conn->fd.get(), path ? *path : settings.nixDaemonSocketFile);