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
commit ab2ef851b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -473,9 +473,14 @@ ref<const ValidPathInfo> RemoteStore::addCAToStore(
worker_proto::write(*this, conn->to, references);
conn->to << repair;
// 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);