Fix RemoteStore pool deadlock in filterSource etc

This commit is contained in:
Robert Hensing 2020-10-30 21:47:34 +01:00
parent dc5696b84f
commit 2192cac634

View file

@ -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);