mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-07-29 12:00:32 +00:00
Use memoization for commits on diffs
The Gitaly CommitService is being hammered by n + 1 calls, mostly when
finding commits. This leads to this gRPC being turned of on production:
https://gitlab.com/gitlab-org/gitaly/issues/514#note_48991378
Hunting down where it came from, most of them were due to
MergeRequest#show. To prove this, I set a script to request the
MergeRequest#show page 50 times. The GDK was being scraped by
Prometheus, where we have metrics on controller#action and their Gitaly
calls performed. On both occations I've restarted the full GDK so all
caches had to be rebuild.
Current master, 806a68a81f
, needed 435 requests
After this commit, 154 requests
This commit is contained in:
@ -19,6 +19,8 @@ module Gitlab
|
||||
commit_message: commit_message || default_commit_message
|
||||
}
|
||||
resolver.resolve_conflicts(user, files, args)
|
||||
ensure
|
||||
@merge_request.clear_memoized_shas
|
||||
end
|
||||
|
||||
def files
|
||||
|
Reference in New Issue
Block a user