diff options
-rw-r--r-- | src/libstore/remote-store.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index fb52ca6d0..b6f70057d 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -473,9 +473,14 @@ ref<const ValidPathInfo> RemoteStore::addCAToStore( worker_proto::write(*this, conn->to, references); conn->to << repair; - conn.withFramedSink([&](Sink & sink) { - dump.drainInto(sink); - }); + // The dump source may invoke the store, so we need to make some room. + connections->incCapacity(); + { + Finally cleanup([&]() { connections->decCapacity(); }); + conn.withFramedSink([&](Sink & sink) { + dump.drainInto(sink); + }); + } auto path = parseStorePath(readString(conn->from)); return readValidPathInfo(conn, path); |