Repository fails to push due to repeated checks on path locks
Steps to reproduce.
- git clone --mirror https://review.gerrithub.io/spdk/spdk.git
- git add remote test YOUR-PROJECT-URL-HERE
- git push test --mirror
GitLab will fail with: https://gitlab.com/snippets/1724861?expanded=true&viewer=simple
I attached gdb
to the unicorn process while this was happening on my local instance and ran call rb_backtrace()
. You can see we repeatedly check the path locks:
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/instrumentation.rb:159:in `block in check_push_access!'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/git_access.rb:252:in `check_push_access!'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/instrumentation.rb:159:in `check_change_access!'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/method_call.rb:36:in `measure'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/instrumentation.rb:159:in `block in check_change_access!'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/git_access.rb:266:in `check_change_access!'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/git_access.rb:266:in `with_index'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/git_access.rb:266:in `each'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/git_access.rb:271:in `block in check_change_access!'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/instrumentation.rb:159:in `check_single_change_access'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/method_call.rb:36:in `measure'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/instrumentation.rb:159:in `block in check_single_change_access'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/git_access.rb:314:in `check_single_change_access'
from /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/checks/change_access.rb:26:in `exec'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/instrumentation.rb:159:in `commits_check'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/method_call.rb:36:in `measure'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/instrumentation.rb:159:in `block in commits_check'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/checks/change_access.rb:126:in `commits_check'
from /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/checks/change_access.rb:167:in `should_run_commit_validations?'
from /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/checks/change_access.rb:191:in `validate_path_locks?'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/utils/strong_memoize.rb:26:in `strong_memoize'
from /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/checks/change_access.rb:193:in `block in validate_path_locks?'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_proxy.rb:806:in `any?'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_association.rb:351:in `any?'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/associations/has_many_association.rb:49:in `empty?'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_association.rb:341:in `empty?'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/relation/finder_methods.rb:302:in `exists?'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql/database_statements.rb:50:in `select_value'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:584:in `execute_and_clear'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `exec_no_cache'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/notifications/instrumenter.rb:18:in `instrument'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/notifications/instrumenter.rb:31:in `start'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/notifications/fanout.rb:42:in `start'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_support/notifications/fanout.rb:55:in `listeners_for'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/thread_safe-0.3.6/lib/thread_safe/cache.rb:36:in `[]'
from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/thread_safe-0.3.6/lib/thread_safe/non_concurrent_cache_backend.rb:12:in `[]'