Skip to content

Optimize JIRA ref lookup

Stan Hu requested to merge sh-optimize-jira-ref-retrieval into master

What does this MR do and why?

In a project with JIRA activated, ProcessCommitWorker attempts to add a comment to a JIRA issue if that issue is mentioned in a commit. However, the JIRA integration would attempt to retrieve all tags and branches and pick the first matching ref given a commit OID.

The problem with that approach is that after each push, the list of all branches and tags are expired and could take a while to gather. Since multiple ProcessCommitWorker jobs can be running at the same time, this can lead to high I/O on Gitaly nodes since multiple ProcessCommitWorker jobs can run at the same time.

We observe that we don't really need to build the entire ref list; we can just ask Gitaly for a single matching ref for the given OID with the newly-created FindRefsByOID RPC introduced in gitaly!3947 (merged).

Relates to #343035 (closed)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports

Loading