Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,332
    • Merge requests 1,332
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #337039
Closed
Open
Issue created Jul 27, 2021 by Thong Kuah@tkuah5️⃣Maintainer4 of 4 checklist items completed4/4 checklist items

Hanging specs when databases decomposed

These feature specs hangs on this MR:

  • spec/features/merge_request/user_sees_pipelines_spec.rb - !80848 (merged)
  • spec/features/admin/admin_runners_spec.rb
  • spec/features/triggers_spec.rb
  • spec/features/expand_collapse_diffs_spec.rb
  • [-] ee/spec/features/registrations/combined_registration_spec.rb

Reproduction

$ export GITLAB_USE_MODEL_LOAD_BALANCING=true
$ export CACHE_CLASSES=true
$ export GITLAB_TEST_EAGER_LOAD=true
$ bin/rspec -f d spec/features/admin/admin_runners_spec.rb

**hangs**

At this stage start lldb on mac, or gdb

$ lldb
(lldb) process attach --pid 73448

# See https://saveriomiroddi.github.io/Debugging-a-live-stuck-ruby-process-with-gdb-fully-explained-plus-many-goodies/#other-interesting-sources
(lldb) call (void) rb_p((unsigned long) rb_eval_string_protect("Thread.list.each {|t| puts t; puts t.backtrace}", (int*)0))

Alternative install https://github.com/fluent/sigdump#install which will give you a nice dump of all Threads' backtraces.

Investigation

I confirmed that spec/features/merge_request/user_sees_pipelines_spec.rb is definitely hanging on the autoload lock (load_interlock_aware_monitor.rb)

  • From a discussion: (+1 comment)

    Hang with spec/features/merge_request/user_sees_pipelines_spec.rb

    Found this piece of magic in the internet, which lists the backtrace of every Thread:

    call rb_p(rb_eval_string_protect("Thread.list.each {|t| puts t; puts t.backtrace.join(%Q[\n]); }", (int*)0))

    thread_backtraces.txt

    The backtraces is stuck in load_interlock_aware_monitor.rb:17

    Possibly relevant issues :

    • https://github.com/rails/rails/issues/37092
    • https://github.com/rails/rails/issues/27025
    • https://github.com/rails/rails/issues/34310

thread_backtraces.txt

Edited Feb 22, 2022 by Thong Kuah
Assignee
Assign to
Time tracking