Loading
Handle commit stats timeouts gracefully
What does this MR do and why?
Contributes to https://gitlab.com/gitlab-org/gitlab/-/issues/635511
Problem
Gitlab::Git::CommitStats#fetch_stats does not cache failures, so commits that exceed Gitaly's 30-second deadline pay the full timeout on every retry. A stats failure also turns a successfully loaded commit into an API 500, causing integrations to retry in a loop.
Solution
- Behind the default-off
commit_stats_failure_handlingflag, remember project-repository timeouts for 10 minutes under a separate cache key. - When enabled, omit
statsand logGitlab::Git::CommandErrorfailures inAPI::Entities::CommitDetail.
References
How to set up and validate locally
No manual setup is required.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.