Projects::PipelinesController#index (pipelines.json) is calling Gitaly n+1 times per invocation
When visiting pipelines page for a project, the ajax request to grab all of the pipelines will fail with a 500 internal server error and I can never see any pipelines listed
- GitLab CE
master
,$GDK/gitlab
, gitlab-ce@aec1586c05f30c1a81928b441cd63e422752e56c -
$GDK/gitaly/src/gitlab.com/gitlab-org/gitaly
, 3cec5a47
Visit <namespace>/<project>/pipelines
-> Ajax GET <namespace>/<project>/pipelines.json?scope=all&page=1
Gitlab::GitalyClient::TooManyInvocationsError in Projects::PipelinesController#index
GitalyClient#migrate called 31 times from single request. Potential n+1?
The following call site called into Gitaly 16 times:
/Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/gitaly_client.rb:131:in `migrate'
/Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/git/repository.rb:1088:in `gitaly_migrate'
/Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/git/commit.rb:63:in `find'
/Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/models/repository.rb:105:in `commit'
/Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/models/project.rb:517:in `commit'
/Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/models/ci/pipeline.rb:293:in `latest?'
/Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/delegator/plain_object.rb:6:in `delegate'
/Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/entity.rb:490:in `delegate_attribute'
/Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/delegator_exposure.rb:6:in `value'
/Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:79:in `valid_value'
/Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:63:in `serializable_value'
/Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:61:in `block (2 levels) in serializable_value'
It looks like Gitaly is running,
ps aux | grep gitaly
eric 4020 0.1 0.1 2626420 12216 s005 S+ 12:47PM 0:31.84 bin/gitaly-ruby 4000 /var/folders/z_/_m9m0xpn0kb_pl20hh5pvvnh0000gn/T/gitaly-ruby872112313/socket
eric 21123 0.0 0.1 556652352 13772 s002 S+ 3:53PM 0:00.29 gitaly/bin/gitaly /Users/eric/Documents/gitlab/gitlab-development-kit/gitaly/config.toml
GDK log around the request
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg=spawn args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 4b7766eea985318b7c5435fc1ec22f705584aad7 --]" grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= pid=21563 span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=8 peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="spawn complete" args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 4b7766eea985318b7c5435fc1ec22f705584aad7 --]" command.exitCode=0 command.inblock=0 command.maxrss=1515520 command.oublock=0 command.real_time_ms=8.432604 command.system_time_ms=1.119 command.user_time_ms=2.275 grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg=spawn args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 investigate-empty-artifacts --]" grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= pid=21564 span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=7 peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="spawn complete" args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 investigate-empty-artifacts --]" command.exitCode=0 command.inblock=0 command.maxrss=1507328 command.oublock=0 command.real_time_ms=8.062746 command.system_time_ms=1.229 command.user_time_ms=2.2110000000000003 grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg=spawn args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 23d1b20f4f6a0b4049851a2563aff30bdbaf2fae --]" grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= pid=21565 span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=7 peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="spawn complete" args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 23d1b20f4f6a0b4049851a2563aff30bdbaf2fae --]" command.exitCode=0 command.inblock=0 command.maxrss=1507328 command.oublock=0 command.real_time_ms=7.674937000000001 command.system_time_ms=0.93 command.user_time_ms=2.0380000000000003 grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg=spawn args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 investigate-empty-artifacts --]" grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= pid=21566 span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=9 peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="spawn complete" args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 investigate-empty-artifacts --]" command.exitCode=0 command.inblock=0 command.maxrss=1593344 command.oublock=0 command.real_time_ms=9.617705 command.system_time_ms=1.957 command.user_time_ms=2.4160000000000004 grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg=spawn args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 6aff23b5a948698624271a919bab04ccdda43057 --]" grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= pid=21567 span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=8 peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="spawn complete" args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 6aff23b5a948698624271a919bab04ccdda43057 --]" command.exitCode=0 command.inblock=0 command.maxrss=1507328 command.oublock=0 command.real_time_ms=8.736335000000002 command.system_time_ms=1.122 command.user_time_ms=2.174 grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg=spawn args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 investigate-empty-artifacts --]" grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= pid=21568 span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=7 peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="spawn complete" args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 investigate-empty-artifacts --]" command.exitCode=0 command.inblock=0 command.maxrss=1511424 command.oublock=0 command.real_time_ms=7.352393 command.system_time_ms=1.1800000000000002 command.user_time_ms=2.157 grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg=spawn args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 d5b2847d74e1f57fa43a7f128e8105d41821f67f --]" grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= pid=21569 span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=6 peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="spawn complete" args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 d5b2847d74e1f57fa43a7f128e8105d41821f67f --]" command.exitCode=0 command.inblock=0 command.maxrss=1507328 command.oublock=0 command.real_time_ms=6.995571000000001 command.system_time_ms=0.8870000000000001 command.user_time_ms=1.9790000000000003 grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg=spawn args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 investigate-empty-artifacts --]" grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= pid=21570 span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=7 peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="spawn complete" args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 investigate-empty-artifacts --]" command.exitCode=0 command.inblock=0 command.maxrss=1507328 command.oublock=0 command.real_time_ms=7.551 command.system_time_ms=1.0040000000000002 command.user_time_ms=2.019 grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg=spawn args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 84cb4a6623f7c4cc8706db65e05f59d338e23d18 --]" grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= pid=21571 span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=7 peer.address= span.kind=server system=grpc
15:55:26 gitaly.1 | time="2017-09-29T15:55:26-05:00" level=info msg="spawn complete" args="[/usr/bin/git --git-dir /Users/eric/Documents/gitlab/gitlab-development-kit/repositories/root/playing-with-selenium.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 84cb4a6623f7c4cc8706db65e05f59d338e23d18 --]" command.exitCode=0 command.inblock=0 command.maxrss=1515520 command.oublock=0 command.real_time_ms=7.593891 command.system_time_ms=0.9380000000000001 command.user_time_ms=2.045 grpc.method=FindCommit grpc.request.repoPath=root/playing-with-selenium.git grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService path=/usr/bin/git peer.address= span.kind=server system=grpc
15:55:26 gitlab-workhorse.1 | 192.168.1.135:3000 192.168.1.135:50426 - - [2017-09-29 15:55:25.570253 -0500 CDT] "GET /root/playing-with-selenium/pipelines.json?scope=all&page=1 HTTP/1.1" 500 165913 "http://192.168.1.135:3000/root/playing-with-selenium/pipelines" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.38 Safari/537.36" 1.306455
<img src="https://i.imgur.com/0Teoc0q.png" width=50%">
I tried with rails console
-> Feature.disable(:gitaly_tags)
and without, Feature.enable(:gitaly_tags)
.
Workaround
If it’s blocking you from getting any work done, as a temporary measure, return early in
GitalyClient.enforce_gitaly_request_limits
That’ll help you workaround the issue while I finish off https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14451
-- @andrewn, https://gitlab.slack.com/archives/C3ER3TQBT/p1506719216000296
cc @andrewn
Designs
- Show closed items
Is blocked by
Relates to
- gitlab-foss #24262
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Andrew Newdigate added gitlab-ce~27312481 ~168008 labels
added gitlab-ce~27312481 ~168008 labels
- Eric Eastwood changed the description
changed the description
- Eric Eastwood changed the description
changed the description
- Developer
@MadLittleMods if you disable the workaround, are you still seeing this exception? If so, please could you include the full stacktrace. I don't think we're deep enough to be down to the level of the n+1 loop in the snippet you provided.
- Andrew Newdigate assigned to @MadLittleMods
assigned to @MadLittleMods
- Author Contributor
@andrewn Full error response/stacktrace from ajax
GET <namespace>/<project>/pipelines.json?scope=all&page=1
:500 error response/stacktrace
Gitlab::GitalyClient::TooManyInvocationsError in Projects::PipelinesController#index GitalyClient#migrate called 31 times from single request. Potential n+1? The following call site called into Gitaly 16 times: /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/gitaly_client.rb:131:in `migrate' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/git/repository.rb:1088:in `gitaly_migrate' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/git/commit.rb:63:in `find' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/models/repository.rb:105:in `commit' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/models/project.rb:517:in `commit' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/models/ci/pipeline.rb:293:in `latest?' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/delegator/plain_object.rb:6:in `delegate' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/entity.rb:490:in `delegate_attribute' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/delegator_exposure.rb:6:in `value' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:79:in `valid_value' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:63:in `serializable_value' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:61:in `block (2 levels) in serializable_value' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:109:in `block in with_attr_path' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/options.rb:102:in `with_attr_path' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:108:in `with_attr_path' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:60:in `block in serializable_value' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:59:in `each' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:59:in `each_with_object' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:59:in `serializable_value' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:61:in `block (2 levels) in serializable_value' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:109:in `block in with_attr_path' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/options.rb:102:in `with_attr_path' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/base.rb:108:in `with_attr_path' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:60:in `block in serializable_value' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:59:in `each' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:59:in `each_with_object' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/exposure/nesting_exposure.rb:59:in `serializable_value' /Users/eric/.rvm/gems/ruby-2.3.3/gems/grape-entity-0.6.0/lib/grape_entity/entity.rb:471:in `serializable_hash' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/core_ext/object/json.rb:140:in `block in as_json' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/core_ext/object/json.rb:140:in `map' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/core_ext/object/json.rb:140:in `as_json' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/serializers/base_serializer.rb:11:in `represent' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/serializers/pipeline_serializer.rb:29:in `represent' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/controllers/projects/pipelines_controller.rb:41:in `block (2 levels) in index' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_controller/metal/mime_responds.rb:217:in `respond_to' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/controllers/projects/pipelines_controller.rb:32:in `index' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/abstract_controller/base.rb:198:in `process_action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/abstract_controller/callbacks.rb:20:in `block in process_action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:117:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:505:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:498:in `block (2 levels) in around' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/i18n.rb:47:in `with_locale' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/i18n.rb:53:in `with_user_locale' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/controllers/application_controller.rb:328:in `set_locale' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:432:in `block in make_lambda' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:312:in `block in halting' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:497:in `block in around' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:505:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:498:in `block (2 levels) in around' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:298:in `block in halting_and_conditional' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:497:in `block in around' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:505:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:92:in `__run_callbacks__' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/abstract_controller/callbacks.rb:19:in `process_action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `block in instrument' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `instrument' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_controller/metal/instrumentation.rb:30:in `process_action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_controller/metal/params_wrapper.rb:250:in `process_action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/abstract_controller/base.rb:137:in `process' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionview-4.2.8/lib/action_view/rendering.rb:30:in `process' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_controller/metal.rb:196:in `dispatch' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_controller/metal.rb:237:in `block in action' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:74:in `dispatch' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:43:in `serve' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/routing/mapper.rb:49:in `serve' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:43:in `block in serve' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:30:in `each' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:30:in `serve' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:817:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/peek-performance_bar-1.3.0/lib/peek/views/performance_bar/process_utilization.rb:120:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/middleware/multipart.rb:93:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/request_profiler/middleware.rb:14:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/middleware/go.rb:17:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/flipper-0.10.2/lib/flipper/middleware/memoizer.rb:55:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/etag_caching/middleware.rb:23:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/warden-1.2.6/lib/warden/manager.rb:35:in `block in call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/warden-1.2.6/lib/warden/manager.rb:34:in `catch' /Users/eric/.rvm/gems/ruby-2.3.3/gems/warden-1.2.6/lib/warden/manager.rb:34:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-cors-0.4.0/lib/rack/cors.rb:80:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-attack-4.4.1/lib/rack/attack.rb:107:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/etag.rb:24:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/conditionalget.rb:25:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/head.rb:13:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/params_parser.rb:27:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/flash.rb:260:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/session/abstract/id.rb:225:in `context' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/session/abstract/id.rb:220:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/cookies.rb:560:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.8/lib/active_record/query_cache.rb:36:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.8/lib/active_record/migration.rb:377:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:88:in `__run_callbacks__' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_call_callbacks' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/reloader.rb:73:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/remote_ip.rb:78:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:59:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/railties-4.2.8/lib/rails/rack/logger.rb:38:in `call_app' /Users/eric/.rvm/gems/ruby-2.3.3/gems/railties-4.2.8/lib/rails/rack/logger.rb:20:in `block in call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/tagged_logging.rb:68:in `block in tagged' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/tagged_logging.rb:26:in `tagged' /Users/eric/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.8/lib/active_support/tagged_logging.rb:68:in `tagged' /Users/eric/.rvm/gems/ruby-2.3.3/gems/railties-4.2.8/lib/rails/rack/logger.rb:20:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/sprockets-rails-3.2.0/lib/sprockets/rails/quiet_assets.rb:13:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/request_context.rb:18:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/request_store-1.3.1/lib/request_store/middleware.rb:9:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/request_id.rb:21:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/methodoverride.rb:22:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/runtime.rb:18:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/lock.rb:17:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/actionpack-4.2.8/lib/action_dispatch/middleware/static.rb:120:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/middleware/static.rb:9:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/middleware/webpack_proxy.rb:20:in `perform_request' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-proxy-0.6.0/lib/rack/proxy.rb:57:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/sendfile.rb:113:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/sentry-raven-2.5.3/lib/raven/integrations/rack.rb:50:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/railties-4.2.8/lib/rails/engine.rb:518:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/railties-4.2.8/lib/rails/application.rb:165:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `public_send' /Users/eric/.rvm/gems/ruby-2.3.3/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `method_missing' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/urlmap.rb:66:in `block in call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/urlmap.rb:50:in `each' /Users/eric/.rvm/gems/ruby-2.3.3/gems/rack-1.6.8/lib/rack/urlmap.rb:50:in `call' /Users/eric/.rvm/gems/ruby-2.3.3/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:562:in `process_client' /Users/eric/.rvm/gems/ruby-2.3.3/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:658:in `worker_loop' /Users/eric/.rvm/gems/ruby-2.3.3/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:508:in `spawn_missing_workers' /Users/eric/.rvm/gems/ruby-2.3.3/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:132:in `start' /Users/eric/.rvm/gems/ruby-2.3.3/gems/unicorn-5.1.0/bin/unicorn_rails:209:in `' /Users/eric/.rvm/gems/ruby-2.3.3/bin/unicorn_rails:22:in `load' /Users/eric/.rvm/gems/ruby-2.3.3/bin/unicorn_rails:22:in `' /Users/eric/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `eval' /Users/eric/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `' Extracted source (around line #168): 166 167 168 169 170 171 </td> return if permitted_call_count <= MAXIMUM_GITALY_CALLS raise TooManyInvocationsError.new(call_site, actual_call_count, max_call_count, max_stacks) end def self.allow_n_plus_1_calls Extracted source (around line #131): 129 130 131 132 133 134 # Enforce limits at both the `migrate` and `call` sites to ensure that # problems are not hidden by a feature being disabled enforce_gitaly_request_limits(:migrate) is_enabled = feature_enabled?(feature, status: status) metric_name = feature.to_s Extracted source (around line #1088): 1086 1087 1088 1089 1090 1091 def gitaly_migrate(method, status: Gitlab::GitalyClient::MigrationStatus::OPT_IN, &block) Gitlab::GitalyClient.migrate(method, status: status, &block) rescue GRPC::NotFound => e raise NoRepository.new(e) rescue GRPC::BadStatus => e Extracted source (around line #63): 61 62 63 64 65 66 return nil unless commit_id.is_a?(String) commit = repo.gitaly_migrate(:find_commit) do |is_enabled| if is_enabled repo.gitaly_commit_client.find_commit(commit_id) else Extracted source (around line #105): 103 104 105 106 107 108 ref else Gitlab::Git::Commit.find(raw_repository, ref) end commit = ::Commit.new(commit, @project) if commit Extracted source (around line #517): 515 516 517 518 519 520 def commit(ref = 'HEAD') repository.commit(ref) end # ref can't be HEAD, can only be branch/tag name or SHA Extracted source (around line #293): 291 292 293 294 295 296 def latest? return false unless ref commit = project.commit(ref) return false unless commit commit.sha == sha end Extracted source (around line #6): 4 5 6 7 8 9 class PlainObject < Base def delegate(attribute) object.send attribute end def delegatable?(attribute) Extracted source (around line #490): 488 489 490 491 492 493 send(attribute) else delegator.delegate(attribute) end end Extracted source (around line #6): 4 5 6 7 8 9 class DelegatorExposure < Base def value(entity, _options) entity.delegate_attribute(attribute) end end end Extracted source (around line #79): 77 78 79 80 81 82 def valid_value(entity, options) value(entity, options) if valid?(entity) end def should_return_key?(options) Extracted source (around line #63): 61 62 63 64 65 66 def serializable_value(entity, options) partial_output = valid_value(entity, options) if partial_output.respond_to?(:serializable_hash) partial_output.serializable_hash Extracted source (around line #61): 59 60 61 62 63 64 normalized_exposures(entity, new_options).each_with_object(output) do |exposure, out| exposure.with_attr_path(entity, new_options) do result = exposure.serializable_value(entity, new_options) out.add(exposure, result) end end Extracted source (around line #109): 107 108 109 110 111 112 path_part = attr_path(entity, options) options.with_attr_path(path_part) do yield end end Extracted source (around line #102): 100 101 102 103 104 105 if part stack.push part result = yield stack.pop result else Extracted source (around line #108): 106 107 108 109 110 111 def with_attr_path(entity, options) path_part = attr_path(entity, options) options.with_attr_path(path_part) do yield end end Extracted source (around line #60): 58 59 60 61 62 63 normalized_exposures(entity, new_options).each_with_object(output) do |exposure, out| exposure.with_attr_path(entity, new_options) do result = exposure.serializable_value(entity, new_options) out.add(exposure, result) end Extracted source (around line #59): 57 58 59 60 61 62 output = OutputBuilder.new normalized_exposures(entity, new_options).each_with_object(output) do |exposure, out| exposure.with_attr_path(entity, new_options) do result = exposure.serializable_value(entity, new_options) out.add(exposure, result) Extracted source (around line #59): 57 58 59 60 61 62 output = OutputBuilder.new normalized_exposures(entity, new_options).each_with_object(output) do |exposure, out| exposure.with_attr_path(entity, new_options) do result = exposure.serializable_value(entity, new_options) out.add(exposure, result) Extracted source (around line #59): 57 58 59 60 61 62 output = OutputBuilder.new normalized_exposures(entity, new_options).each_with_object(output) do |exposure, out| exposure.with_attr_path(entity, new_options) do result = exposure.serializable_value(entity, new_options) out.add(exposure, result) Extracted source (around line #61): 59 60 61 62 63 64 normalized_exposures(entity, new_options).each_with_object(output) do |exposure, out| exposure.with_attr_path(entity, new_options) do result = exposure.serializable_value(entity, new_options) out.add(exposure, result) end end Extracted source (around line #109): 107 108 109 110 111 112 path_part = attr_path(entity, options) options.with_attr_path(path_part) do yield end end Extracted source (around line #102): 100 101 102 103 104 105 if part stack.push part result = yield stack.pop result else Extracted source (around line #108): 106 107 108 109 110 111 def with_attr_path(entity, options) path_part = attr_path(entity, options) options.with_attr_path(path_part) do yield end end Extracted source (around line #60): 58 59 60 61 62 63 normalized_exposures(entity, new_options).each_with_object(output) do |exposure, out| exposure.with_attr_path(entity, new_options) do result = exposure.serializable_value(entity, new_options) out.add(exposure, result) end Extracted source (around line #59): 57 58 59 60 61 62 output = OutputBuilder.new normalized_exposures(entity, new_options).each_with_object(output) do |exposure, out| exposure.with_attr_path(entity, new_options) do result = exposure.serializable_value(entity, new_options) out.add(exposure, result) Extracted source (around line #59): 57 58 59 60 61 62 output = OutputBuilder.new normalized_exposures(entity, new_options).each_with_object(output) do |exposure, out| exposure.with_attr_path(entity, new_options) do result = exposure.serializable_value(entity, new_options) out.add(exposure, result) Extracted source (around line #59): 57 58 59 60 61 62 output = OutputBuilder.new normalized_exposures(entity, new_options).each_with_object(output) do |exposure, out| exposure.with_attr_path(entity, new_options) do result = exposure.serializable_value(entity, new_options) out.add(exposure, result) Extracted source (around line #471): 469 470 471 472 473 474 opts = options.merge(runtime_options || {}) root_exposure.serializable_value(self, opts) end def exec_with_object(options, &block) Extracted source (around line #140): 138 139 140 141 142 143 class Array def as_json(options = nil) #:nodoc: map { |v| options ? v.as_json(options.dup) : v.as_json } end end Extracted source (around line #140): 138 139 140 141 142 143 class Array def as_json(options = nil) #:nodoc: map { |v| options ? v.as_json(options.dup) : v.as_json } end end Extracted source (around line #140): 138 139 140 141 142 143 class Array def as_json(options = nil) #:nodoc: map { |v| options ? v.as_json(options.dup) : v.as_json } end end Extracted source (around line #11): 9 10 11 12 13 14 entity_class .represent(resource, opts.merge(request: @request)) .as_json end def self.entity(entity_class) Extracted source (around line #29): 27 28 29 30 31 32 if paginated? super(@paginator.paginate(resource), opts) else super(resource, opts) end Extracted source (around line #41): 39 40 41 42 43 44 .new(project: @project, current_user: @current_user) .with_pagination(request, response) .represent(@pipelines), count: { all: @pipelines_count, running: @running_count, Extracted source (around line #217): 215 216 217 218 219 220 _process_format(format) response = collector.response response ? response.call : render({}) else raise ActionController::UnknownFormat end Extracted source (around line #32): 30 31 32 33 34 35 .new(project).execute.count respond_to do |format| format.html format.json do Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL) Extracted source (around line #4): 2 3 4 5 6 7 module ImplicitRender def send_action(method, *args) ret = super default_render unless performed? ret end Extracted source (around line #198): 196 197 198 199 200 201 # which is *not* necessarily the same as the action name. def process_action(method_name, *args) send_action(method_name, *args) end # Actually call the method associated with the action. Override Extracted source (around line #10): 8 9 10 11 12 13 def process_action(*) #:nodoc: self.formats = request.formats.map(&:ref).compact super end # Check for double render errors and set the content_type after rendering. Extracted source (around line #20): 18 19 20 21 22 23 def process_action(*args) run_callbacks(:process_action) do super end end Extracted source (around line #117): 115 116 117 118 119 120 def call(env) block = env.run_block env.value = !env.halted && (!block || block.call) env end end Extracted source (around line #555): 553 554 555 556 557 558 def compile @callbacks || @mutex.synchronize do final_sequence = CallbackSequence.new { |env| Filters::ENDING.call(env) } @callbacks ||= @chain.reverse.inject(final_sequence) do |callback_sequence, callback| callback.apply callback_sequence end Extracted source (around line #505): 503 504 505 506 507 508 def call(*args) @before.each { |b| b.call(*args) } value = @call.call(*args) @after.each { |a| a.call(*args) } value end Extracted source (around line #498): 496 497 498 499 500 501 CallbackSequence.new do |*args| around.call(*args) { self.call(*args) } end end Extracted source (around line #313): 311 312 313 314 315 316 else user_callback.call(target, value) { env = run.call env env.value } env Extracted source (around line #47): 45 46 47 48 49 50 self.locale = locale_string yield ensure self.locale = original_locale end Extracted source (around line #53): 51 52 53 54 55 56 def with_user_locale(user, &block) with_locale(user&.preferred_language, &block) end def with_default_locale(&block) Extracted source (around line #328): 326 327 328 329 330 331 def set_locale(&block) Gitlab::I18n.with_user_locale(current_user, &block) end def sessionless_sign_in(user) Extracted source (around line #432): 430 431 432 433 434 435 case filter when Symbol lambda { |target, _, &blk| target.send filter, &blk } when String l = eval "lambda { |value| #{filter} }" lambda { |target, value| target.instance_exec(value, &l) } Extracted source (around line #312): 310 311 312 313 314 315 run.call env else user_callback.call(target, value) { env = run.call env env.value } Extracted source (around line #497): 495 496 497 498 499 500 def around(&around) CallbackSequence.new do |*args| around.call(*args) { self.call(*args) } end Extracted source (around line #505): 503 504 505 506 507 508 def call(*args) @before.each { |b| b.call(*args) } value = @call.call(*args) @after.each { |a| a.call(*args) } value end Extracted source (around line #498): 496 497 498 499 500 501 CallbackSequence.new do |*args| around.call(*args) { self.call(*args) } end end Extracted source (around line #298): 296 297 298 299 300 301 env else run.call env end end end Extracted source (around line #497): 495 496 497 498 499 500 def around(&around) CallbackSequence.new do |*args| around.call(*args) { self.call(*args) } end Extracted source (around line #505): 503 504 505 506 507 508 def call(*args) @before.each { |b| b.call(*args) } value = @call.call(*args) @after.each { |a| a.call(*args) } value end Extracted source (around line #92): 90 91 92 93 94 95 runner = callbacks.compile e = Filters::Environment.new(self, false, nil, block) runner.call(e).value end end Extracted source (around line #778): 776 777 778 779 780 781 module_eval <<-RUBY, __FILE__, __LINE__ + 1 def _run_#{name}_callbacks(&block) __run_callbacks__(_#{name}_callbacks, &block) end RUBY end Extracted source (around line #81): 79 80 81 82 83 84 # end def run_callbacks(kind, &block) send "_run_#{kind}_callbacks", &block end private Extracted source (around line #19): 17 18 19 20 21 22 # process_action callbacks around the normal behavior. def process_action(*args) run_callbacks(:process_action) do super end end Extracted source (around line #29): 27 28 29 30 31 32 private def process_action(*args) super rescue Exception => exception request.env['action_dispatch.show_detailed_exceptions'] ||= show_detailed_exceptions? rescue_with_handler(exception) || raise(exception) Extracted source (around line #32): 30 31 32 33 34 35 ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload| begin result = super payload[:status] = response.status result ensure Extracted source (around line #164): 162 163 164 165 166 167 def instrument(name, payload = {}) if notifier.listening?(name) instrumenter.instrument(name, payload) { yield payload if block_given? } else yield payload if block_given? end Extracted source (around line #20): 18 19 20 21 22 23 start name, payload begin yield payload rescue Exception => e payload[:exception] = [e.class.name, e.message] raise e Extracted source (around line #164): 162 163 164 165 166 167 def instrument(name, payload = {}) if notifier.listening?(name) instrumenter.instrument(name, payload) { yield payload if block_given? } else yield payload if block_given? end Extracted source (around line #30): 28 29 30 31 32 33 ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload.dup) ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload| begin result = super payload[:status] = response.status Extracted source (around line #250): 248 249 250 251 252 253 request.filtered_parameters.merge! wrapped_filtered_hash end super end private Extracted source (around line #18): 16 17 18 19 20 21 # and it won't be cleaned up by the method below. ActiveRecord::LogSubscriber.reset_runtime super end def cleanup_view_runtime Extracted source (around line #137): 135 136 137 138 139 140 @_response_body = nil process_action(action_name, *args) end # Delegates to the class' #controller_path Extracted source (around line #30): 28 29 30 31 32 33 def process(*) #:nodoc: old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context) super ensure I18n.config = old_config end Extracted source (around line #196): 194 195 196 197 198 199 @_env = request.env @_env['action_controller.instance'] = self process(name) to_a end Extracted source (around line #13): 11 12 13 14 15 16 def dispatch(action, request) set_response!(request) super(action, request) end def response_body=(body) Extracted source (around line #237): 235 236 237 238 239 240 end else lambda { |env| new.dispatch(name, klass.new(env)) } end end end Extracted source (around line #74): 72 73 74 75 76 77 def dispatch(controller, action, env) controller.action(action).call(env) end def normalize_controller!(params) Extracted source (around line #43): 41 42 43 44 45 46 end dispatch(controller, params[:action], req.env) end def prepare_params!(params) Extracted source (around line #49): 47 48 49 50 51 52 if dispatcher? @app.serve req else @app.call req.env end Extracted source (around line #43): 41 42 43 44 45 46 req.path_parameters = set_params.merge parameters status, headers, body = route.app.serve(req) if 'pass' == headers['X-Cascade'] req.script_name = script_name Extracted source (around line #30): 28 29 30 31 32 33 def serve(req) find_routes(req).each do |match, parameters, route| set_params = req.path_parameters path_info = req.path_info script_name = req.script_name Extracted source (around line #30): 28 29 30 31 32 33 def serve(req) find_routes(req).each do |match, parameters, route| set_params = req.path_parameters path_info = req.path_info script_name = req.script_name Extracted source (around line #817): 815 816 817 818 819 820 req = request_class.new(env) req.path_info = Journey::Router::Utils.normalize_path(req.path_info) @router.serve(req) end def recognize_path(path, environment = {}) Extracted source (around line #120): 118 119 120 121 122 123 env['process.total_requests'] = total_requests status, headers, body = @app.call(env) body = Rack::BodyProxy.new(body) { record_request } [status, headers, body] end Extracted source (around line #93): 91 92 93 94 95 96 def call(env) encoded_message = env.delete(RACK_ENV_KEY) return @app.call(env) if encoded_message.blank? message = Gitlab::Workhorse.decode_jwt(encoded_message)[0] Extracted source (around line #14): 12 13 14 15 16 17 call_with_profiling(env) else @app.call(env) end end Extracted source (around line #17): 15 16 17 18 19 20 request = Rack::Request.new(env) render_go_doc(request) || @app.call(env) end private Extracted source (around line #55): 53 54 55 56 57 58 end response = @app.call(env) response[2] = Rack::BodyProxy.new(response[2]) { flipper.adapter.memoize = original } Extracted source (around line #23): 21 22 23 24 25 26 track_cache_miss(if_none_match, cached_value_present, route) status, headers, body = @app.call(env) headers['ETag'] = etag [status, headers, body] end Extracted source (around line #35): 33 34 35 36 37 38 env['warden'] = Proxy.new(env, self) result = catch(:warden) do @app.call(env) end result ||= {} Extracted source (around line #34): 32 33 34 35 36 37 env['warden'] = Proxy.new(env, self) result = catch(:warden) do @app.call(env) end Extracted source (around line #34): 32 33 34 35 36 37 env['warden'] = Proxy.new(env, self) result = catch(:warden) do @app.call(env) end Extracted source (around line #80): 78 79 80 81 82 83 vary_resource = resource_for_path(env[PATH_INFO_HEADER_KEY]) status, headers, body = @app.call env if add_headers headers = headers.merge(add_headers) Extracted source (around line #107): 105 106 107 108 109 110 else tracked?(req) @app.call(env) end end Extracted source (around line #24): 22 23 24 25 26 27 def call(env) status, headers, body = @app.call(env) if etag_status?(status) && etag_body?(body) && !skip_caching?(headers) original_body = body Extracted source (around line #25): 23 24 25 26 27 28 case env[REQUEST_METHOD] when "GET", "HEAD" status, headers, body = @app.call(env) headers = Utils::HeaderHash.new(headers) if status == 200 && fresh?(env, headers) status = 304 Extracted source (around line #13): 11 12 13 14 15 16 def call(env) status, headers, body = @app.call(env) if env[REQUEST_METHOD] == HEAD [ Extracted source (around line #27): 25 26 27 28 29 30 end @app.call(env) end private Extracted source (around line #260): 258 259 260 261 262 263 def call(env) @app.call(env) ensure session = Request::Session.find(env) || {} flash_hash = env[KEY] Extracted source (around line #225): 223 224 225 226 227 228 def context(env, app=@app) prepare_session(env) status, headers, body = app.call(env) commit_session(env, status, headers, body) end Extracted source (around line #220): 218 219 220 221 222 223 def call(env) context(env) end def context(env, app=@app) Extracted source (around line #560): 558 559 560 561 562 563 def call(env) status, headers, body = @app.call(env) if cookie_jar = env['action_dispatch.cookies'] unless cookie_jar.committed? Extracted source (around line #36): 34 35 36 37 38 39 connection.enable_query_cache! response = @app.call(env) response[2] = Rack::BodyProxy.new(response[2]) do restore_query_cache_settings(connection_id, enabled) end Extracted source (around line #653): 651 652 653 654 655 656 testing = env['rack.test'] response = @app.call(env) response[2] = ::Rack::BodyProxy.new(response[2]) do ActiveRecord::Base.clear_active_connections! unless testing end Extracted source (around line #377): 375 376 377 378 379 380 end end @app.call(env) end private Extracted source (around line #29): 27 28 29 30 31 32 result = run_callbacks :call do begin @app.call(env) rescue => error end end Extracted source (around line #88): 86 87 88 89 90 91 def __run_callbacks__(callbacks, &block) if callbacks.empty? yield if block_given? else runner = callbacks.compile e = Filters::Environment.new(self, false, nil, block) Extracted source (around line #778): 776 777 778 779 780 781 module_eval <<-RUBY, __FILE__, __LINE__ + 1 def _run_#{name}_callbacks(&block) __run_callbacks__(_#{name}_callbacks, &block) end RUBY end Extracted source (around line #81): 79 80 81 82 83 84 # end def run_callbacks(kind, &block) send "_run_#{kind}_callbacks", &block end private Extracted source (around line #27): 25 26 27 28 29 30 def call(env) error = nil result = run_callbacks :call do begin @app.call(env) rescue => error Extracted source (around line #73): 71 72 73 74 75 76 prepare! response = @app.call(env) response[2] = ::Rack::BodyProxy.new(response[2]) { cleanup! } response Extracted source (around line #78): 76 77 78 79 80 81 def call(env) env["action_dispatch.remote_ip"] = GetIp.new(env, self) @app.call(env) end # The GetIp class exists as a way to defer processing of the request data Extracted source (around line #59): 57 58 59 60 61 62 better_errors_call env else @app.call env end end Extracted source (around line #17): 15 16 17 18 19 20 def call(env) _, headers, body = response = @app.call(env) if headers['X-Cascade'] == 'pass' body.close if body.respond_to?(:close) Extracted source (around line #30): 28 29 30 31 32 33 def call(env) @app.call(env) rescue Exception => exception if env['action_dispatch.show_exceptions'] == false raise exception Extracted source (around line #38): 36 37 38 39 40 41 instrumenter.start 'request.action_dispatch', request: request logger.info { started_request_message(request) } resp = @app.call(env) resp[2] = ::Rack::BodyProxy.new(resp[2]) { finish(request) } resp rescue Exception Extracted source (around line #20): 18 19 20 21 22 23 if logger.respond_to?(:tagged) logger.tagged(compute_tags(request)) { call_app(request, env) } else call_app(request, env) end Extracted source (around line #68): 66 67 68 69 70 71 def tagged(*tags) formatter.tagged(*tags) { yield self } end def flush Extracted source (around line #26): 24 25 26 27 28 29 def tagged(*tags) new_tags = push_tags(*tags) yield self ensure pop_tags(new_tags.size) end Extracted source (around line #68): 66 67 68 69 70 71 def tagged(*tags) formatter.tagged(*tags) { yield self } end def flush Extracted source (around line #20): 18 19 20 21 22 23 if logger.respond_to?(:tagged) logger.tagged(compute_tags(request)) { call_app(request, env) } else call_app(request, env) end Extracted source (around line #13): 11 12 13 14 15 16 ::Rails.logger.silence { @app.call(env) } else @app.call(env) end end end Extracted source (around line #18): 16 17 18 19 20 21 RequestStore[:client_ip] = req.ip @app.call(env) end end end Extracted source (around line #9): 7 8 9 10 11 12 def call(env) RequestStore.begin! @app.call(env) ensure RequestStore.end! RequestStore.clear! Extracted source (around line #21): 19 20 21 22 23 24 def call(env) env["action_dispatch.request_id"] = external_request_id(env) || internal_request_id @app.call(env).tap { |_status, headers, _body| headers["X-Request-Id"] = env["action_dispatch.request_id"] } end private Extracted source (around line #22): 20 21 22 23 24 25 end @app.call(env) end def method_override(env) Extracted source (around line #18): 16 17 18 19 20 21 def call(env) start_time = clock_time status, headers, body = @app.call(env) request_time = clock_time - start_time if !headers.has_key?(@header_name) Extracted source (around line #17): 15 16 17 18 19 20 old, env[FLAG] = env[FLAG], false @mutex.lock response = @app.call(env) body = BodyProxy.new(response[2]) { @mutex.unlock } response[2] = body response Extracted source (around line #120): 118 119 120 121 122 123 end @app.call(env) end end end Extracted source (around line #9): 7 8 9 10 11 12 return @app.call(env) if env['PATH_INFO'] =~ UPLOADS_REGEX super end end end Extracted source (around line #20): 18 19 20 21 22 23 super(env) else @app.call(env) end end end Extracted source (around line #57): 55 56 57 58 59 60 def call(env) rewrite_response(perform_request(rewrite_env(env))) end # Return modified env Extracted source (around line #113): 111 112 113 114 115 116 def call(env) status, headers, body = @app.call(env) if body.respond_to?(:to_path) case type = variation(env) when 'X-Accel-Redirect' Extracted source (around line #27): 25 26 27 28 29 30 RequestsRackMiddleware.http_request_total.increment(method: method) status, headers, body = @app.call(env) elapsed = Time.now.to_f - started RequestsRackMiddleware.http_request_duration_seconds.observe({ method: method, status: status }, elapsed) Extracted source (around line #50): 48 49 50 51 52 53 begin response = @app.call(env) rescue Error raise # Don't capture Raven errors rescue Exception => e Extracted source (around line #518): 516 517 518 519 520 521 env["ROUTES_#{routes.object_id}_SCRIPT_NAME"] = env['SCRIPT_NAME'].dup end app.call(env) end # Defines additional Rack env configuration that is added on each call. Extracted source (around line #165): 163 164 165 166 167 168 env["ORIGINAL_FULLPATH"] = build_original_fullpath(env) env["ORIGINAL_SCRIPT_NAME"] = env["SCRIPT_NAME"] super(env) end # Reload application routes regardless if they changed or not. Extracted source (around line #194): 192 193 194 195 196 197 def method_missing(name, *args, &block) if instance.respond_to?(name) instance.public_send(name, *args, &block) else super end Extracted source (around line #194): 192 193 194 195 196 197 def method_missing(name, *args, &block) if instance.respond_to?(name) instance.public_send(name, *args, &block) else super end Extracted source (around line #66): 64 65 66 67 68 69 env['PATH_INFO'] = rest return app.call(env) end [404, {CONTENT_TYPE => "text/plain", "X-Cascade" => "pass"}, ["Not Found: #{path}"]] Extracted source (around line #50): 48 49 50 51 52 53 sPort = env['SERVER_PORT'] @mapping.each do |host, location, match, app| unless casecmp?(hHost, host) \ || casecmp?(sName, host) \ || (!host && (casecmp?(hHost, sName) || Extracted source (around line #50): 48 49 50 51 52 53 sPort = env['SERVER_PORT'] @mapping.each do |host, location, match, app| unless casecmp?(hHost, host) \ || casecmp?(sName, host) \ || (!host && (casecmp?(hHost, sName) || Extracted source (around line #562): 560 561 562 563 564 565 # in 3 easy steps: read request, call app, write app response def process_client(client) status, headers, body = @app.call(env = @request.read(client)) begin return if @request.hijacked? Extracted source (around line #658): 656 657 658 659 660 661 # but that will return false if client = sock.kgio_tryaccept process_client(client) nr += 1 worker.tick = time_now.to_i end Extracted source (around line #508): 506 507 508 509 510 511 else after_fork_internal worker_loop(worker) exit end end Extracted source (around line #132): 130 131 132 133 134 135 bind_new_listeners! spawn_missing_workers self end Extracted source (around line #209): 207 208 209 Unicorn::Launcher.daemonize!(options) end Unicorn::HttpServer.new(app, options).start.join Extracted source (around line #22): 20 21 22 end load Gem.activate_bin_path('unicorn', 'unicorn_rails', version) Extracted source (around line #22): 20 21 22 end load Gem.activate_bin_path('unicorn', 'unicorn_rails', version) Extracted source (around line #15): 13 14 15 end eval File.read($0), binding, $0 Extracted source (around line #15): 13 14 15 end eval File.read($0), binding, $0 Rails.root: /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab Application Trace lib/gitlab/gitaly_client.rb:168:in enforce_gitaly_request_limits' lib/gitlab/gitaly_client.rb:131:in migrate' lib/gitlab/git/repository.rb:1088:in gitaly_migrate' lib/gitlab/git/commit.rb:63:in find' app/models/repository.rb:105:in commit' app/models/project.rb:517:in commit' app/models/ci/pipeline.rb:293:in latest?' app/serializers/base_serializer.rb:11:in represent' app/serializers/pipeline_serializer.rb:29:in represent' app/controllers/projects/pipelines_controller.rb:41:in block (2 levels) in index' app/controllers/projects/pipelines_controller.rb:32:in index' lib/gitlab/i18n.rb:47:in with_locale' lib/gitlab/i18n.rb:53:in with_user_locale' app/controllers/application_controller.rb:328:in set_locale' lib/gitlab/middleware/multipart.rb:93:in call' lib/gitlab/request_profiler/middleware.rb:14:in call' lib/gitlab/middleware/go.rb:17:in call' lib/gitlab/etag_caching/middleware.rb:23:in call' lib/gitlab/request_context.rb:18:in call' lib/gitlab/middleware/static.rb:9:in call' lib/gitlab/middleware/webpack_proxy.rb:20:in perform_request' lib/gitlab/metrics/requests_rack_middleware.rb:27:in call' Framework Trace grape-entity (0.6.0) lib/grape_entity/delegator/plain_object.rb:6:in delegate' grape-entity (0.6.0) lib/grape_entity/entity.rb:490:in delegate_attribute' grape-entity (0.6.0) lib/grape_entity/exposure/delegator_exposure.rb:6:in value' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:79:in valid_value' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:63:in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:61:in block (2 levels) in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:109:in block in with_attr_path' grape-entity (0.6.0) lib/grape_entity/options.rb:102:in with_attr_path' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:108:in with_attr_path' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:60:in block in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in each' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in each_with_object' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:61:in block (2 levels) in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:109:in block in with_attr_path' grape-entity (0.6.0) lib/grape_entity/options.rb:102:in with_attr_path' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:108:in with_attr_path' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:60:in block in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in each' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in each_with_object' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in serializable_value' grape-entity (0.6.0) lib/grape_entity/entity.rb:471:in serializable_hash' activesupport (4.2.8) lib/active_support/core_ext/object/json.rb:140:in block in as_json' activesupport (4.2.8) lib/active_support/core_ext/object/json.rb:140:in map' activesupport (4.2.8) lib/active_support/core_ext/object/json.rb:140:in as_json' actionpack (4.2.8) lib/action_controller/metal/mime_responds.rb:217:in respond_to' actionpack (4.2.8) lib/action_controller/metal/implicit_render.rb:4:in send_action' actionpack (4.2.8) lib/abstract_controller/base.rb:198:in process_action' actionpack (4.2.8) lib/action_controller/metal/rendering.rb:10:in process_action' actionpack (4.2.8) lib/abstract_controller/callbacks.rb:20:in block in process_action' activesupport (4.2.8) lib/active_support/callbacks.rb:117:in call' activesupport (4.2.8) lib/active_support/callbacks.rb:555:in block (2 levels) in compile' activesupport (4.2.8) lib/active_support/callbacks.rb:505:in call' activesupport (4.2.8) lib/active_support/callbacks.rb:498:in block (2 levels) in around' activesupport (4.2.8) lib/active_support/callbacks.rb:313:in block (2 levels) in halting' activesupport (4.2.8) lib/active_support/callbacks.rb:432:in block in make_lambda' activesupport (4.2.8) lib/active_support/callbacks.rb:312:in block in halting' activesupport (4.2.8) lib/active_support/callbacks.rb:497:in block in around' activesupport (4.2.8) lib/active_support/callbacks.rb:505:in call' activesupport (4.2.8) lib/active_support/callbacks.rb:498:in block (2 levels) in around' activesupport (4.2.8) lib/active_support/callbacks.rb:298:in block in halting_and_conditional' activesupport (4.2.8) lib/active_support/callbacks.rb:497:in block in around' activesupport (4.2.8) lib/active_support/callbacks.rb:505:in call' activesupport (4.2.8) lib/active_support/callbacks.rb:92:in __run_callbacks__' activesupport (4.2.8) lib/active_support/callbacks.rb:778:in _run_process_action_callbacks' activesupport (4.2.8) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (4.2.8) lib/abstract_controller/callbacks.rb:19:in process_action' actionpack (4.2.8) lib/action_controller/metal/rescue.rb:29:in process_action' actionpack (4.2.8) lib/action_controller/metal/instrumentation.rb:32:in block in process_action' activesupport (4.2.8) lib/active_support/notifications.rb:164:in block in instrument' activesupport (4.2.8) lib/active_support/notifications/instrumenter.rb:20:in instrument' activesupport (4.2.8) lib/active_support/notifications.rb:164:in instrument' actionpack (4.2.8) lib/action_controller/metal/instrumentation.rb:30:in process_action' actionpack (4.2.8) lib/action_controller/metal/params_wrapper.rb:250:in process_action' activerecord (4.2.8) lib/active_record/railties/controller_runtime.rb:18:in process_action' actionpack (4.2.8) lib/abstract_controller/base.rb:137:in process' actionview (4.2.8) lib/action_view/rendering.rb:30:in process' actionpack (4.2.8) lib/action_controller/metal.rb:196:in dispatch' actionpack (4.2.8) lib/action_controller/metal/rack_delegation.rb:13:in dispatch' actionpack (4.2.8) lib/action_controller/metal.rb:237:in block in action' actionpack (4.2.8) lib/action_dispatch/routing/route_set.rb:74:in dispatch' actionpack (4.2.8) lib/action_dispatch/routing/route_set.rb:43:in serve' actionpack (4.2.8) lib/action_dispatch/routing/mapper.rb:49:in serve' actionpack (4.2.8) lib/action_dispatch/journey/router.rb:43:in block in serve' actionpack (4.2.8) lib/action_dispatch/journey/router.rb:30:in each' actionpack (4.2.8) lib/action_dispatch/journey/router.rb:30:in serve' actionpack (4.2.8) lib/action_dispatch/routing/route_set.rb:817:in call' peek-performance_bar (1.3.0) lib/peek/views/performance_bar/process_utilization.rb:120:in call' flipper (0.10.2) lib/flipper/middleware/memoizer.rb:55:in call' warden (1.2.6) lib/warden/manager.rb:35:in block in call' warden (1.2.6) lib/warden/manager.rb:34:in catch' warden (1.2.6) lib/warden/manager.rb:34:in call' rack-cors (0.4.0) lib/rack/cors.rb:80:in call' rack-attack (4.4.1) lib/rack/attack.rb:107:in call' rack (1.6.8) lib/rack/etag.rb:24:in call' rack (1.6.8) lib/rack/conditionalget.rb:25:in call' rack (1.6.8) lib/rack/head.rb:13:in call' actionpack (4.2.8) lib/action_dispatch/middleware/params_parser.rb:27:in call' actionpack (4.2.8) lib/action_dispatch/middleware/flash.rb:260:in call' rack (1.6.8) lib/rack/session/abstract/id.rb:225:in context' rack (1.6.8) lib/rack/session/abstract/id.rb:220:in call' actionpack (4.2.8) lib/action_dispatch/middleware/cookies.rb:560:in call' activerecord (4.2.8) lib/active_record/query_cache.rb:36:in call' activerecord (4.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in call' activerecord (4.2.8) lib/active_record/migration.rb:377:in call' actionpack (4.2.8) lib/action_dispatch/middleware/callbacks.rb:29:in block in call' activesupport (4.2.8) lib/active_support/callbacks.rb:88:in __run_callbacks__' activesupport (4.2.8) lib/active_support/callbacks.rb:778:in _run_call_callbacks' activesupport (4.2.8) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (4.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (4.2.8) lib/action_dispatch/middleware/reloader.rb:73:in call' actionpack (4.2.8) lib/action_dispatch/middleware/remote_ip.rb:78:in call' better_errors (2.1.1) lib/better_errors/middleware.rb:59:in call' actionpack (4.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:17:in call' actionpack (4.2.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in call' railties (4.2.8) lib/rails/rack/logger.rb:38:in call_app' railties (4.2.8) lib/rails/rack/logger.rb:20:in block in call' activesupport (4.2.8) lib/active_support/tagged_logging.rb:68:in block in tagged' activesupport (4.2.8) lib/active_support/tagged_logging.rb:26:in tagged' activesupport (4.2.8) lib/active_support/tagged_logging.rb:68:in tagged' railties (4.2.8) lib/rails/rack/logger.rb:20:in call' sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in call' request_store (1.3.1) lib/request_store/middleware.rb:9:in call' actionpack (4.2.8) lib/action_dispatch/middleware/request_id.rb:21:in call' rack (1.6.8) lib/rack/methodoverride.rb:22:in call' rack (1.6.8) lib/rack/runtime.rb:18:in call' rack (1.6.8) lib/rack/lock.rb:17:in call' actionpack (4.2.8) lib/action_dispatch/middleware/static.rb:120:in call' rack-proxy (0.6.0) lib/rack/proxy.rb:57:in call' rack (1.6.8) lib/rack/sendfile.rb:113:in call' sentry-raven (2.5.3) lib/raven/integrations/rack.rb:50:in call' railties (4.2.8) lib/rails/engine.rb:518:in call' railties (4.2.8) lib/rails/application.rb:165:in call' railties (4.2.8) lib/rails/railtie.rb:194:in public_send' railties (4.2.8) lib/rails/railtie.rb:194:in method_missing' rack (1.6.8) lib/rack/urlmap.rb:66:in block in call' rack (1.6.8) lib/rack/urlmap.rb:50:in each' rack (1.6.8) lib/rack/urlmap.rb:50:in call' unicorn (5.1.0) lib/unicorn/http_server.rb:562:in process_client' unicorn (5.1.0) lib/unicorn/http_server.rb:658:in worker_loop' unicorn (5.1.0) lib/unicorn/http_server.rb:508:in spawn_missing_workers' unicorn (5.1.0) lib/unicorn/http_server.rb:132:in start' unicorn (5.1.0) bin/unicorn_rails:209:in <top (required)>' /Users/eric/.rvm/gems/ruby-2.3.3/bin/unicorn_rails:22:in load' /Users/eric/.rvm/gems/ruby-2.3.3/bin/unicorn_rails:22:in <main>' /Users/eric/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in eval' /Users/eric/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `' Full Trace lib/gitlab/gitaly_client.rb:168:in enforce_gitaly_request_limits' lib/gitlab/gitaly_client.rb:131:in migrate' lib/gitlab/git/repository.rb:1088:in gitaly_migrate' lib/gitlab/git/commit.rb:63:in find' app/models/repository.rb:105:in commit' app/models/project.rb:517:in commit' app/models/ci/pipeline.rb:293:in latest?' grape-entity (0.6.0) lib/grape_entity/delegator/plain_object.rb:6:in delegate' grape-entity (0.6.0) lib/grape_entity/entity.rb:490:in delegate_attribute' grape-entity (0.6.0) lib/grape_entity/exposure/delegator_exposure.rb:6:in value' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:79:in valid_value' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:63:in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:61:in block (2 levels) in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:109:in block in with_attr_path' grape-entity (0.6.0) lib/grape_entity/options.rb:102:in with_attr_path' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:108:in with_attr_path' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:60:in block in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in each' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in each_with_object' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:61:in block (2 levels) in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:109:in block in with_attr_path' grape-entity (0.6.0) lib/grape_entity/options.rb:102:in with_attr_path' grape-entity (0.6.0) lib/grape_entity/exposure/base.rb:108:in with_attr_path' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:60:in block in serializable_value' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in each' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in each_with_object' grape-entity (0.6.0) lib/grape_entity/exposure/nesting_exposure.rb:59:in serializable_value' grape-entity (0.6.0) lib/grape_entity/entity.rb:471:in serializable_hash' activesupport (4.2.8) lib/active_support/core_ext/object/json.rb:140:in block in as_json' activesupport (4.2.8) lib/active_support/core_ext/object/json.rb:140:in map' activesupport (4.2.8) lib/active_support/core_ext/object/json.rb:140:in as_json' app/serializers/base_serializer.rb:11:in represent' app/serializers/pipeline_serializer.rb:29:in represent' app/controllers/projects/pipelines_controller.rb:41:in block (2 levels) in index' actionpack (4.2.8) lib/action_controller/metal/mime_responds.rb:217:in respond_to' app/controllers/projects/pipelines_controller.rb:32:in index' actionpack (4.2.8) lib/action_controller/metal/implicit_render.rb:4:in send_action' actionpack (4.2.8) lib/abstract_controller/base.rb:198:in process_action' actionpack (4.2.8) lib/action_controller/metal/rendering.rb:10:in process_action' actionpack (4.2.8) lib/abstract_controller/callbacks.rb:20:in block in process_action' activesupport (4.2.8) lib/active_support/callbacks.rb:117:in call' activesupport (4.2.8) lib/active_support/callbacks.rb:555:in block (2 levels) in compile' activesupport (4.2.8) lib/active_support/callbacks.rb:505:in call' activesupport (4.2.8) lib/active_support/callbacks.rb:498:in block (2 levels) in around' activesupport (4.2.8) lib/active_support/callbacks.rb:313:in block (2 levels) in halting' lib/gitlab/i18n.rb:47:in with_locale' lib/gitlab/i18n.rb:53:in with_user_locale' app/controllers/application_controller.rb:328:in set_locale' activesupport (4.2.8) lib/active_support/callbacks.rb:432:in block in make_lambda' activesupport (4.2.8) lib/active_support/callbacks.rb:312:in block in halting' activesupport (4.2.8) lib/active_support/callbacks.rb:497:in block in around' activesupport (4.2.8) lib/active_support/callbacks.rb:505:in call' activesupport (4.2.8) lib/active_support/callbacks.rb:498:in block (2 levels) in around' activesupport (4.2.8) lib/active_support/callbacks.rb:298:in block in halting_and_conditional' activesupport (4.2.8) lib/active_support/callbacks.rb:497:in block in around' activesupport (4.2.8) lib/active_support/callbacks.rb:505:in call' activesupport (4.2.8) lib/active_support/callbacks.rb:92:in __run_callbacks__' activesupport (4.2.8) lib/active_support/callbacks.rb:778:in _run_process_action_callbacks' activesupport (4.2.8) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (4.2.8) lib/abstract_controller/callbacks.rb:19:in process_action' actionpack (4.2.8) lib/action_controller/metal/rescue.rb:29:in process_action' actionpack (4.2.8) lib/action_controller/metal/instrumentation.rb:32:in block in process_action' activesupport (4.2.8) lib/active_support/notifications.rb:164:in block in instrument' activesupport (4.2.8) lib/active_support/notifications/instrumenter.rb:20:in instrument' activesupport (4.2.8) lib/active_support/notifications.rb:164:in instrument' actionpack (4.2.8) lib/action_controller/metal/instrumentation.rb:30:in process_action' actionpack (4.2.8) lib/action_controller/metal/params_wrapper.rb:250:in process_action' activerecord (4.2.8) lib/active_record/railties/controller_runtime.rb:18:in process_action' actionpack (4.2.8) lib/abstract_controller/base.rb:137:in process' actionview (4.2.8) lib/action_view/rendering.rb:30:in process' actionpack (4.2.8) lib/action_controller/metal.rb:196:in dispatch' actionpack (4.2.8) lib/action_controller/metal/rack_delegation.rb:13:in dispatch' actionpack (4.2.8) lib/action_controller/metal.rb:237:in block in action' actionpack (4.2.8) lib/action_dispatch/routing/route_set.rb:74:in dispatch' actionpack (4.2.8) lib/action_dispatch/routing/route_set.rb:43:in serve' actionpack (4.2.8) lib/action_dispatch/routing/mapper.rb:49:in serve' actionpack (4.2.8) lib/action_dispatch/journey/router.rb:43:in block in serve' actionpack (4.2.8) lib/action_dispatch/journey/router.rb:30:in each' actionpack (4.2.8) lib/action_dispatch/journey/router.rb:30:in serve' actionpack (4.2.8) lib/action_dispatch/routing/route_set.rb:817:in call' peek-performance_bar (1.3.0) lib/peek/views/performance_bar/process_utilization.rb:120:in call' lib/gitlab/middleware/multipart.rb:93:in call' lib/gitlab/request_profiler/middleware.rb:14:in call' lib/gitlab/middleware/go.rb:17:in call' flipper (0.10.2) lib/flipper/middleware/memoizer.rb:55:in call' lib/gitlab/etag_caching/middleware.rb:23:in call' warden (1.2.6) lib/warden/manager.rb:35:in block in call' warden (1.2.6) lib/warden/manager.rb:34:in catch' warden (1.2.6) lib/warden/manager.rb:34:in call' rack-cors (0.4.0) lib/rack/cors.rb:80:in call' rack-attack (4.4.1) lib/rack/attack.rb:107:in call' rack (1.6.8) lib/rack/etag.rb:24:in call' rack (1.6.8) lib/rack/conditionalget.rb:25:in call' rack (1.6.8) lib/rack/head.rb:13:in call' actionpack (4.2.8) lib/action_dispatch/middleware/params_parser.rb:27:in call' actionpack (4.2.8) lib/action_dispatch/middleware/flash.rb:260:in call' rack (1.6.8) lib/rack/session/abstract/id.rb:225:in context' rack (1.6.8) lib/rack/session/abstract/id.rb:220:in call' actionpack (4.2.8) lib/action_dispatch/middleware/cookies.rb:560:in call' activerecord (4.2.8) lib/active_record/query_cache.rb:36:in call' activerecord (4.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in call' activerecord (4.2.8) lib/active_record/migration.rb:377:in call' actionpack (4.2.8) lib/action_dispatch/middleware/callbacks.rb:29:in block in call' activesupport (4.2.8) lib/active_support/callbacks.rb:88:in __run_callbacks__' activesupport (4.2.8) lib/active_support/callbacks.rb:778:in _run_call_callbacks' activesupport (4.2.8) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (4.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (4.2.8) lib/action_dispatch/middleware/reloader.rb:73:in call' actionpack (4.2.8) lib/action_dispatch/middleware/remote_ip.rb:78:in call' better_errors (2.1.1) lib/better_errors/middleware.rb:59:in call' actionpack (4.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:17:in call' actionpack (4.2.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in call' railties (4.2.8) lib/rails/rack/logger.rb:38:in call_app' railties (4.2.8) lib/rails/rack/logger.rb:20:in block in call' activesupport (4.2.8) lib/active_support/tagged_logging.rb:68:in block in tagged' activesupport (4.2.8) lib/active_support/tagged_logging.rb:26:in tagged' activesupport (4.2.8) lib/active_support/tagged_logging.rb:68:in tagged' railties (4.2.8) lib/rails/rack/logger.rb:20:in call' sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in call' lib/gitlab/request_context.rb:18:in call' request_store (1.3.1) lib/request_store/middleware.rb:9:in call' actionpack (4.2.8) lib/action_dispatch/middleware/request_id.rb:21:in call' rack (1.6.8) lib/rack/methodoverride.rb:22:in call' rack (1.6.8) lib/rack/runtime.rb:18:in call' rack (1.6.8) lib/rack/lock.rb:17:in call' actionpack (4.2.8) lib/action_dispatch/middleware/static.rb:120:in call' lib/gitlab/middleware/static.rb:9:in call' lib/gitlab/middleware/webpack_proxy.rb:20:in perform_request' rack-proxy (0.6.0) lib/rack/proxy.rb:57:in call' rack (1.6.8) lib/rack/sendfile.rb:113:in call' lib/gitlab/metrics/requests_rack_middleware.rb:27:in call' sentry-raven (2.5.3) lib/raven/integrations/rack.rb:50:in call' railties (4.2.8) lib/rails/engine.rb:518:in call' railties (4.2.8) lib/rails/application.rb:165:in call' railties (4.2.8) lib/rails/railtie.rb:194:in public_send' railties (4.2.8) lib/rails/railtie.rb:194:in method_missing' rack (1.6.8) lib/rack/urlmap.rb:66:in block in call' rack (1.6.8) lib/rack/urlmap.rb:50:in each' rack (1.6.8) lib/rack/urlmap.rb:50:in call' unicorn (5.1.0) lib/unicorn/http_server.rb:562:in process_client' unicorn (5.1.0) lib/unicorn/http_server.rb:658:in worker_loop' unicorn (5.1.0) lib/unicorn/http_server.rb:508:in spawn_missing_workers' unicorn (5.1.0) lib/unicorn/http_server.rb:132:in start' unicorn (5.1.0) bin/unicorn_rails:209:in <top (required)>' /Users/eric/.rvm/gems/ruby-2.3.3/bin/unicorn_rails:22:in load' /Users/eric/.rvm/gems/ruby-2.3.3/bin/unicorn_rails:22:in <main>' /Users/eric/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in eval' /Users/eric/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `' Request parameters {"scope"=>"all", "page"=>"1", "namespace_id"=>"root", "project_id"=>"gitlab-selenium-server", "format"=>"json"} Session dump _csrf_token: "4U/NJnmepZ1NBu59ydXuN8m8lclwUYgsQxqeGNw7pdQ=" warden.user.user.key: [[1], "$2a$10$RoqHPM4Nl890AgtcUSqElO"] Env dump HTTP_ACCEPT: "application/json, text/plain, /" HTTP_ACCEPT_ENCODING: "gzip, deflate" HTTP_ACCEPT_LANGUAGE: "en-US,en;q=0.9,hr;q=0.8,nl;q=0.7" HTTP_CACHE_CONTROL: "no-cache" HTTP_PRAGMA: "no-cache" REMOTE_ADDR: "127.0.0.1" SERVER_NAME: "192.168.1.135" SERVER_PROTOCOL: "HTTP/1.1" Response headers None
Edited by Eric Eastwood - Eric Eastwood assigned to @andrewn
assigned to @andrewn
- Eric Eastwood unassigned @MadLittleMods
unassigned @MadLittleMods
- Developer
@MadLittleMods, for clarity, I've stripped gems from the your stacktrace:
GitalyClient#migrate called 31 times from single request. Potential n+1? The following call site called into Gitaly 16 times: /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/gitaly_client.rb:131:in `migrate' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/git/repository.rb:1088:in `gitaly_migrate' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/git/commit.rb:63:in `find' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/models/repository.rb:105:in `commit' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/models/project.rb:517:in `commit' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/models/ci/pipeline.rb:293:in `latest?' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/serializers/base_serializer.rb:11:in `represent' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/serializers/pipeline_serializer.rb:29:in `represent' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/controllers/projects/pipelines_controller.rb:41:in `block (2 levels) in index' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/controllers/projects/pipelines_controller.rb:32:in `index' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/i18n.rb:47:in `with_locale' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/i18n.rb:53:in `with_user_locale' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/app/controllers/application_controller.rb:328:in `set_locale' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/middleware/multipart.rb:93:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/request_profiler/middleware.rb:14:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/middleware/go.rb:17:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/etag_caching/middleware.rb:23:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/request_context.rb:18:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/middleware/static.rb:9:in `call' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/middleware/webpack_proxy.rb:20:in `perform_request' /Users/eric/Documents/gitlab/gitlab-development-kit/gitlab/lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
From this, it seems that the problem is that
PipelineSerializer
is callingCi::Pipeline#latest?
for each pipeline to be serialised.def latest? return false unless ref commit = project.commit(ref) return false unless commit commit.sha == sha end
So, for each pipline,
latest?
is called, resulting in a Gitaly round-trip.I'll create an exclusion for this, but we'll need to batch fetch this information for all the pipelines being represented ideally.
- Andrew Newdigate mentioned in issue gitaly#514 (closed)
mentioned in issue gitaly#514 (closed)
- Andrew Newdigate mentioned in issue gitaly#321 (closed)
mentioned in issue gitaly#321 (closed)
- blackst0ne added gitlab-ce~24926493 label
added gitlab-ce~24926493 label
- 🤖 GitLab Bot 🤖 added gitlab-ce
3857529a gitlab-ce7638922 labelsadded gitlab-ce
3857529a gitlab-ce7638922 labels - Contributor
/cc @ayufan @jlenny for scheduling
- James Ramsay (ex-GitLab) added 1 deleted label and removed default-priority default-severity labels
added 1 deleted label and removed default-priority default-severity labels
- Jason Yavorska added devopsverify + 1 deleted label and removed 1 deleted label
added devopsverify + 1 deleted label and removed 1 deleted label
- James Ramsay (ex-GitLab) added to epic &827
added to epic &827
- Contributor
- James Ramsay (ex-GitLab) added Gitaly n+1 label
added Gitaly n+1 label
- James Ramsay (ex-GitLab) added customer+ label
added customer+ label
- James Ramsay (ex-GitLab) mentioned in epic &827
mentioned in epic &827
- James Ramsay (ex-GitLab) changed milestone to %Backlog
changed milestone to %Backlog
- Developer
@jramsay thanks for raising it. I'll adjust the severity to gitlab-ce~3713902 which will keep it higher our radar.
- Brendan O'Leary changed milestone to %11.11
changed milestone to %11.11
- Zeger-Jan van de Weg unassigned @andrewn
unassigned @andrewn
- 🤖 GitLab Bot 🤖 added [deprecated] Accepting merge requests label
added [deprecated] Accepting merge requests label
- James Ramsay (ex-GitLab) mentioned in issue gitlab-com/Product#233 (closed)
mentioned in issue gitlab-com/Product#233 (closed)
- James Ramsay (ex-GitLab) added priority1 label and removed priority2 label
- James Ramsay (ex-GitLab) added priority2 label and removed priority1 label
- Contributor
- Contributor
@erushton we didn't complete this in %11.11 and planning is already complete for %12.0 so I'm moving it to %12.1. Let me know if it should be somewhere else.
Edited by Brendan O'Leary - Brendan O'Leary changed milestone to %12.2
changed milestone to %12.2
- Brendan O'Leary changed milestone to %12.1
changed milestone to %12.1
- Maintainer
Recent changes from @grzesiek may have solved this. We need to verify whether this still happens.
- Maintainer
@fabiopitino This still happens in the
PipelinesController#index
because we still check for if a pipeline is the latest one, and we do that for ever ref we can have for a given set of pipelines we want to display. This is a legitimate Gitaly call, but we should be able to batch them and make just one Gitaly request.Edited by Grzegorz Bizon 1 Collapse replies - Maintainer
Ci::Pipeline#latest?
is loading two commits:def latest? return false unless git_ref && commit.present? project.commit(git_ref) == commit end
From these two, only
project.commit(git_ref)
is not loaded usingBatchLoader
. I don't think that gitaly!1365 (merged) is going to help us solve this problem because it doesn't contain anyref
information in the response to be used to merge the two arrays back together:def lazy_ref(container, ref) BatchLoader.for({ container: container, ref: ref }).batch(replace_methods: false) do |items, loader| items_by_container = items.group_by { |i| i[:container] } items_by_container.each do |container, refs| names = refs.map { |i| i[:ref] } container.repository.commits_by_ref_name(ref_names: names).each do |commit| # we need to extract `container:` and `ref:` from the commit object # to link it back to the caller loader.call({ container: commit.container, ref: ... }, commit) if commit end end end end
We could use
Gitlab::Git::Repository#refs_hash
to fetch the information needed forlatest?
, but it doesn't support filtering and it might be worse for projects with a lot of refs because it brings too much data.@grzesiek, @fabiopitino do you have any suggestions on how to get around this?
- Maintainer
@mbobin if we do the opposite, like getting a list of refs by name, then each returning ref should have a commit ID. Would it work?
container.repository.ref_names(names).each do |ref| # ref_names doesn't exist. We need to see if there is something similar in Gitaly. commit = ref.dereferenced_target loader.call({ ref: ref.name }, commit) if commit end
- Maintainer
@fabiopitino, yeah, that would be perfect, but we don't have anything like that in Gitaly. We have support only for all branches and all tags requests: https://gitlab.com/gitlab-org/gitaly/-/tree/master/internal/service/ref
I think we need to merge them into one service and add filtering by ref name.
Edited by Marius Bobin
- Developer
@fabiopitino how about you take a look at this for %12.1
- Elliot Rushton assigned to @fabiopitino
assigned to @fabiopitino
- 🤖 GitLab Bot 🤖 removed [deprecated] Accepting merge requests label
removed [deprecated] Accepting merge requests label
- Maintainer
@fabiopitino We could use the
BatchLoader
what is a really smart mechanism that helps us to avoid N+1. 1 - Elliot Rushton added Deliverable label
added Deliverable label
- Maintainer
Linking here an example of how to use
BatchLoader
for later reference: https://github.com/exAspArk/batch-loader#basic-example Collapse replies - Maintainer
We have a bunch of examples in our codebase as well. We are successfully using it since a some time already.
- Jason Yavorska added Category:Continuous Integration label
added Category:Continuous Integration label
- James Ramsay (ex-GitLab) mentioned in issue gitlab-com/Product#304 (closed)
mentioned in issue gitlab-com/Product#304 (closed)
- James Ramsay (ex-GitLab) changed epic to &1190 (closed)
changed epic to &1190 (closed)
- James Ramsay (ex-GitLab) mentioned in epic &1190 (closed)
mentioned in epic &1190 (closed)
- Fabio Pitino added workflowin dev label
added workflowin dev label
- 🤖 GitLab Bot 🤖 added SLOMissed label
added SLOMissed label
- Contributor
@fabiopitino @erushton did this make %12.1? The issue is still open so I'm not sure. If not, since it's a gitlab-ce~3857523 I suggest we move to %12.2.
- Maintainer
Milestone %12.1 for this gitlab-ce
992791 issue has expired and the issue is considered a gitlab-ce3804821. - 🤖 GitLab Bot 🤖 added missed-deliverable label
added missed-deliverable label
- Maintainer
Milestone %12.1 for this gitlab-ce
992791 issue has expired and the issue is considered a gitlab-ce3804821. - Developer
@jlenny no the MR is still WIP
- Elliot Rushton changed milestone to %12.2
changed milestone to %12.2
- Jason Yavorska added grouppipeline execution label
added grouppipeline execution label
- Maintainer
- Zeger-Jan van de Weg added devopscreate label and removed devopsverify + 1 deleted label
added devopscreate label and removed devopsverify + 1 deleted label
- Fabio Pitino changed milestone to %12.3
changed milestone to %12.3
- Maintainer
- Fabio Pitino added workflowready for development label and removed workflowin dev label
added workflowready for development label and removed workflowin dev label
- 🤖 GitLab Bot 🤖 changed milestone to %12.3
changed milestone to %12.3
- Contributor
- Jason Yavorska changed milestone to %12.4
changed milestone to %12.4
- Jason Yavorska added missed:12.3 label
added missed:12.3 label
- Jason Yavorska added missed:12.2 label
added missed:12.2 label
- 🤖 GitLab Bot 🤖 mentioned in issue #34385 (closed)
mentioned in issue #34385 (closed)
- 🤖 GitLab Bot 🤖 added missed:12.4 label
added missed:12.4 label
- Contributor
- Jason Yavorska changed milestone to %12.5
changed milestone to %12.5
- Fabio Pitino changed weight to 3
changed weight to 3
- 🤖 GitLab Bot 🤖 added missed:12.5 label
added missed:12.5 label
- 🤖 GitLab Bot 🤖 changed milestone to %12.6
changed milestone to %12.6
- Fabio Pitino added workflowscheduling label and removed workflowready for development label
added workflowscheduling label and removed workflowready for development label
- Fabio Pitino added workflowready for development label and removed workflowscheduling label
added workflowready for development label and removed workflowscheduling label
- Contributor
Per discussion at CI Schedulining, updating milestone and moving to scheduling.
- Thao Yeager removed milestone
removed milestone
- Thao Yeager added workflowscheduling label and removed workflowready for development label
added workflowscheduling label and removed workflowready for development label
- 🤖 GitLab Bot 🤖 changed milestone to %Backlog
changed milestone to %Backlog
- 🤖 GitLab Bot 🤖 removed Deliverable label
removed Deliverable label
- Thao Yeager mentioned in issue verify-stage#9 (closed)
mentioned in issue verify-stage#9 (closed)
- Lin Jen-Shin removed 1 deleted label
removed 1 deleted label
- James Ramsay (ex-GitLab) changed epic to &827
changed epic to &827
- Marius Bobin changed milestone to %12.10
changed milestone to %12.10
- Marius Bobin added workflowin dev label and removed workflowscheduling label
added workflowin dev label and removed workflowscheduling label
- Marius Bobin assigned to @mbobin and unassigned @fabiopitino
assigned to @mbobin and unassigned @fabiopitino
- 🤖 GitLab Bot 🤖 changed milestone to %13.0
changed milestone to %13.0
- 🤖 GitLab Bot 🤖 added missed:12.10 label
added missed:12.10 label
- Marius Bobin mentioned in issue gitaly#2692 (closed)
mentioned in issue gitaly#2692 (closed)
- Marius Bobin marked this issue as related to gitaly#2692 (closed)
marked this issue as related to gitaly#2692 (closed)
- Marius Bobin added workflowblocked label and removed workflowin dev label
added workflowblocked label and removed workflowin dev label
- Maintainer
Unassigning myself because this issue is blocked by: gitaly#2692 (closed)
Edited by Marius Bobin - Marius Bobin unassigned @mbobin
unassigned @mbobin
- 🤖 GitLab Bot 🤖 changed milestone to %13.1
changed milestone to %13.1
- 🤖 GitLab Bot 🤖 added missed:13.0 label
added missed:13.0 label
- Developer
@grzesiek @fabiopitino since this issue is blocked by a gitaly change, I'm curious if the proposed work to be done is something that we could pick up, or if we'd need the gitaly team to be involved? WDYT? gitaly#2692 (closed)
/cc @cheryl.li
Collapse replies - Maintainer
@darbyfrey I assigned this issue to myself and I will try to understand what really needs to be done on the Gitaly side, and hopefully I will be able to tackle this without the help from Gitaly team
(except of the review, of course )Edited by Grzegorz Bizon 1 - Maintainer
Sounds good, I'll link to this issue from our %13.1 Planning issue just to track our work in progress.
/cc: @thaoyeager
- Grzegorz Bizon assigned to @grzesiek
assigned to @grzesiek
- Cheryl Li added devopsverify label and removed devopscreate label
added devopsverify label and removed devopscreate label
- Maintainer
@grzesiek I'm updating the Health status to
at risk
given that we're still blocked on this issue, would that be accurate? - Cheryl Li changed health status to at risk
changed health status to at risk
- Grzegorz Bizon mentioned in merge request !34160 (merged)
mentioned in merge request !34160 (merged)
- Grzegorz Bizon added workflowin dev label and removed workflowblocked label
added workflowin dev label and removed workflowblocked label
- Cheryl Li changed health status to needs attention
changed health status to needs attention
- Grzegorz Bizon added workflowin review label and removed workflowin dev label
added workflowin review label and removed workflowin dev label
- Cheryl Li added missed:13.1 label
added missed:13.1 label
- Fabio Pitino closed via merge request !34160 (merged)
closed via merge request !34160 (merged)
- Fabio Pitino mentioned in commit 77291e34
mentioned in commit 77291e34
- Maintainer
@grzesiek reopening this as it's being closed automatically by the MR. I've moved it instead to workflowverification
1 - Fabio Pitino reopened
reopened
- Fabio Pitino added workflowverification label and removed workflowin review label
added workflowverification label and removed workflowin review label
- Maintainer
The improvement misbehaves in production - #224523 (closed). I disabled the feature flag for the time being until I investigate and fix it.
- Maintainer
This has bee fixed and verified on production. Closing.
- Grzegorz Bizon closed
closed
- Maintainer
I managed to check Kibana to understand the impact of this change better. It seems that although we significantly reduced the amount of Gitaly calls:
there is some (perhaps 30%) but not significant difference in Gitaly duration [seconds]:
It means that the new RPC is slower than the old one (what is expected because we need to transfer more data and get more data from a repository), and even though we probably save a lot of time on Gitaly roundtrips, the amount of time we spend on Gitaly is not the problem on gitlab.com for this controller / action.
My conclusion is that we managed to fix Gitaly N+1 here, what is good
, however the time we spend on performing Gitaly request is not something that makes this controller / action slow - further investigation is needed. /cc @darbyfrey @fabiopitino @cheryl.li @thaoyeagerEDIT: this is the data for
gitlab-org/gitlab
project only. The change here might have much bigger impact on customers / users that have different setups that suffer from higher network latencies.Edited by Grzegorz Bizon 4 Collapse replies - Developer
Thanks for the follow up @grzesiek! Is the second graph you're showing the response time for
Projects::PipelinesController#index
or for the Gitaly request portion? Could you provide links to these charts as well? - Maintainer
@darbyfrey this is total Gitaly duration for the controller/action/format request, see https://log.gprd.gitlab.net/goto/0b1665638f14f6c64dcdd165eb9c04f8
- Grzegorz Bizon mentioned in issue gitlab-com/www-gitlab-com#7733 (closed)
mentioned in issue gitlab-com/www-gitlab-com#7733 (closed)
- Grzegorz Bizon mentioned in issue gitlab-com/www-gitlab-com#7729 (closed)
mentioned in issue gitlab-com/www-gitlab-com#7729 (closed)