aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-11-02 14:46:10 +0100
committerGitHub <noreply@github.com>2020-11-02 14:46:10 +0100
commitab2ef851b6dbfa69b4d6a3f8c4bff0642d9e3281 (patch)
treef204bb28ce1dccb5e2c701cc08ac6d2cee19a531 /src/libstore
parentdb5424bf09886afc1c81db36766522f68fc66ba8 (diff)
parent2192cac634dcd13c3365f4dfeb5f393f4fd9e327 (diff)
Merge pull request #4207 from hercules-ci/fix-RemoteStore-filterSource-deadlock
Fix RemoteStore pool deadlock in filterSource etc
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/remote-store.cc11
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);