Commit history page timeout for commits with large descriptions

Summary

When a commit has a very large description (larger than 1MB and several thousand lines), leading the commit history page may timeout.

The timeout was identified to be tied to a the Banzai pipeline which renders markdown in the backend before showing the commits summary in the commit history page.

json.exception.class Rack::Timeout::RequestTimeoutException
json.exception.message Request ran for longer than 60000ms 

As a workaround, we used the newly added timeframe(#441117) committed_before and committed_after to limit the history view but when we select a date wherein the commit with a long description exists, it times out with a 500 error.

Steps to reproduce

  • create a large commit with over 1000 lines in the description and larger than 1MB. In particular, use one that has thousands of links that will require markdown rendering.
  • Select the commit history page and wait for it to timeout with error 500

Example Project

  • Internal team members can review a .com case here

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

   (For installations with omnibus-gitlab package run and paste the output of: \\\\\\\`sudo gitlab-rake gitlab:env:info\\\\\\\`)  (For installations from source run and paste the output of: \\\\\\\`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\\\\\\\`)    

Results of GitLab application Check

Expand for output related to the GitLab application check

  (For installations with omnibus-gitlab package run and paste the output of: \\\`sudo gitlab-rake gitlab:check SANITIZE=true\\\`)  (For installations from source run and paste the output of: \\\`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true\\\`)  (we will only investigate if the tests are passing)   

Possible fixes

The AutolinkFilter doesn't respect the limit of 1000 elements. As a result, this code can cause performance issues.

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.

Edited by 🤖 GitLab Bot 🤖