diff options
author | Robert Hensing <robert@roberthensing.nl> | 2020-10-30 21:47:34 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2020-10-30 21:47:34 +0100 |
commit | 2192cac634dcd13c3365f4dfeb5f393f4fd9e327 (patch) | |
tree | b763dafdbdfdc5be33642571608a8b030da9ae6e /src/libstore/remote-store.cc | |
parent | dc5696b84f55a6706cddc3d747ef1aeffb564f43 (diff) |
Fix RemoteStore pool deadlock in filterSource etc
Diffstat (limited to 'src/libstore/remote-store.cc')
-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 488270f48..ccbd3bb1d 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -471,9 +471,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); |