summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Newdigate <andrew@gitlab.com>2017-09-30 06:54:27 +0000
committerAndrew Newdigate <andrew@gitlab.com>2017-09-30 06:54:27 +0000
commit989421cb4e9c6db8f040c97f636d6ab869dafff2 (patch)
tree9e1218569ae01f95b27acfae72fdc0c034a196b6
parenta1d9a5ac504cce1daff7f1e368dc90fb2c9d92ba (diff)
downloadgitlab-ce-allow_n_plus_1_detection_bypass.tar.gz
-rw-r--r--doc/development/gitaly.md17
1 files changed, 10 insertions, 7 deletions
diff --git a/doc/development/gitaly.md b/doc/development/gitaly.md
index 6174e9493ab..e41d258bec6 100644
--- a/doc/development/gitaly.md
+++ b/doc/development/gitaly.md
@@ -50,27 +50,30 @@ If your test-suite is failing with Gitaly issues, as a first step, try running:
rm -rf tmp/tests/gitaly
```
-## `TooManyInvocationError` errors
+## `TooManyInvocationsError` errors
-During development and testing, you may experience `TooManyInvocationError` failures. The `GitalyClient` will attempt to
-block against potential n+1 issues, by throwing this error when Gitaly is called more than 30 times in a single Rails request.
+During development and testing, you may experience `Gitlab::GitalyClient::TooManyInvocationsError` failures.
+The `GitalyClient` will attempt to block against potential n+1 issues by raising this error
+when Gitaly is called more than 30 times in a single Rails request or Sidekiq execution.
As a temporary measure, export `GITALY_DISABLE_REQUEST_LIMITS=1` to suppress the error. This will disable the n+1 detection
in your development environment.
Please raise an issue in the GitLab CE or EE repositories to report the issue. Include the labels ~Gitaly
~performance ~"technical debt". Please ensure that the issue contains the full stack trace and error message of the
-`TooManyInvocationError`. Also include any known failing tests if possible.
+`TooManyInvocationsError`. Also include any known failing tests if possible.
Isolate the source of the n+1 problem. This will normally be a loop that results in Gitaly being called for each
-element in an array. If you are unable to isolate the problem, please contact a member of the [Gitaly Team](https://gitlab.com/groups/gl-gitaly/group_members) for assistance.
+element in an array. If you are unable to isolate the problem, please contact a member
+of the [Gitaly Team](https://gitlab.com/groups/gl-gitaly/group_members) for assistance.
-Once the source has been found, wrap it in an `allow_n_plus_1_calls` block, as follows.
+Once the source has been found, wrap it in an `allow_n_plus_1_calls` block, as follows:
```ruby
# n+1: link to n+1 issue
Gitlab::GitalyClient.allow_n_plus_1_calls do
- # ...
+ # original code
+ commits.each { |commit| ... }
end
```