Remove branch search limit in favour of a timeout
When there are lots of branches GitLab limits the number of branches searched to 1,000 – this impacts finding out which branches a commit is in.
Gitaly now creates a commit graph for repositories to speed up ancestor queries on revisions, but this graph will only be created once GC has run for repository. For write heavy projects this will happen, but many projects are hardly ever updated and GC never runs. To support both cases a timeout of 2 seconds should be set by the client (Rails) on the RPCs: ListTagNamesContainingCommit
and ListBranchNamesContainingCommit
. This allows Gitaly to stream back the (sub)set or results, and if generating a response takes too long, the client will raise a GRPC::DeadlineExceeded
error. This should than be rescued and the sub result could be used for the end user.
Links / references
Internal Zendesk: https://gitlab.zendesk.com/agent/tickets/89939