Merge pull request #4207 from hercules-ci/fix-RemoteStore-filterSource-deadlock

Fix RemoteStore pool deadlock in filterSource etc
This commit is contained in:
Eelco Dolstra
2020-11-02 14:46:10 +01:00
committed by GitHub
+8 -3
View File
@@ -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);