Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-09-27 01:40:04 +0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-09-27 01:40:48 +0300
commitcae3417381222c527077be5330ef1b2222d31103 (patch)
tree585c4c5339b359e6236594d539b06271172a450e
parent05d8e87dba4abaf9eb495bac147c4d4c5426da2e (diff)
Don't enforce gitaly request limits for distinct calls
-rw-r--r--lib/gitlab/gitaly_client.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index 955d2307f88..3f10951f49e 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -165,7 +165,13 @@ module Gitlab
return if permitted_call_count <= MAXIMUM_GITALY_CALLS
- raise TooManyInvocationsError.new(call_site, actual_call_count, max_call_count, max_stacks)
+ # We've exceeded the limit, but we may still be in the presence of a non
+ # n+1 but still complex request with many distinct calls. If the maximum
+ # call count is 1 or less that's probably the case.
+ max_count = max_call_count
+ return if max_count <= 1
+
+ raise TooManyInvocationsError.new(call_site, actual_call_count, max_count, max_stacks)
end
def self.allow_n_plus_1_calls