aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/remote-store.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 6f1f9769b..be5eb4736 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -541,7 +541,8 @@ ref<const ValidPathInfo> RemoteStore::addCAToStore(
const StorePathSet & references,
RepairFlag repair)
{
- auto conn(getConnection());
+ std::optional<ConnectionHandle> conn_(getConnection());
+ auto & conn = *conn_;
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 25) {
@@ -605,6 +606,8 @@ ref<const ValidPathInfo> RemoteStore::addCAToStore(
}
}, caMethod);
auto path = parseStorePath(readString(conn->from));
+ // Release our connection to prevent a deadlock in queryPathInfo().
+ conn_.reset();
return queryPathInfo(path);
}
}