Commit b755673f authored by Stan Hu's avatar Stan Hu

Add rbtrace to Gemfile

This will be enabled if ENABLE_RBTRACE environment variable is defined.
This will allow us to debug all sorts of issues in production:

https://github.com/tmm1/rbtrace
parent 6cb30f83
...@@ -400,6 +400,7 @@ gem 'email_reply_trimmer', '~> 0.1' ...@@ -400,6 +400,7 @@ gem 'email_reply_trimmer', '~> 0.1'
gem 'html2text' gem 'html2text'
gem 'ruby-prof', '~> 0.17.0' gem 'ruby-prof', '~> 0.17.0'
gem 'rbtrace', '~> 0.4', require: false
# OAuth # OAuth
gem 'oauth2', '~> 1.4' gem 'oauth2', '~> 1.4'
......
...@@ -700,6 +700,10 @@ GEM ...@@ -700,6 +700,10 @@ GEM
ffi (>= 0.5.0, < 2) ffi (>= 0.5.0, < 2)
rblineprof (0.3.6) rblineprof (0.3.6)
debugger-ruby_core_source (~> 1.3) debugger-ruby_core_source (~> 1.3)
rbtrace (0.4.10)
ffi (>= 1.0.6)
msgpack (>= 0.4.3)
trollop (>= 1.16.2)
rdoc (6.0.4) rdoc (6.0.4)
re2 (1.1.1) re2 (1.1.1)
recaptcha (3.0.0) recaptcha (3.0.0)
...@@ -911,6 +915,7 @@ GEM ...@@ -911,6 +915,7 @@ GEM
parslet (~> 1.5.0) parslet (~> 1.5.0)
toml-rb (1.0.0) toml-rb (1.0.0)
citrus (~> 3.0, > 3.0) citrus (~> 3.0, > 3.0)
trollop (2.1.3)
truncato (0.7.10) truncato (0.7.10)
htmlentities (~> 4.3.1) htmlentities (~> 4.3.1)
nokogiri (~> 1.8.0, >= 1.7.0) nokogiri (~> 1.8.0, >= 1.7.0)
...@@ -1133,6 +1138,7 @@ DEPENDENCIES ...@@ -1133,6 +1138,7 @@ DEPENDENCIES
rainbow (~> 2.2) rainbow (~> 2.2)
raindrops (~> 0.18) raindrops (~> 0.18)
rblineprof (~> 0.3.6) rblineprof (~> 0.3.6)
rbtrace (~> 0.4)
rdoc (~> 6.0) rdoc (~> 6.0)
re2 (~> 1.1.1) re2 (~> 1.1.1)
recaptcha (~> 3.0) recaptcha (~> 3.0)
......
...@@ -709,6 +709,10 @@ GEM ...@@ -709,6 +709,10 @@ GEM
ffi (>= 0.5.0, < 2) ffi (>= 0.5.0, < 2)
rblineprof (0.3.6) rblineprof (0.3.6)
debugger-ruby_core_source (~> 1.3) debugger-ruby_core_source (~> 1.3)
rbtrace (0.4.10)
ffi (>= 1.0.6)
msgpack (>= 0.4.3)
trollop (>= 1.16.2)
rdoc (6.0.4) rdoc (6.0.4)
re2 (1.1.1) re2 (1.1.1)
recaptcha (3.0.0) recaptcha (3.0.0)
...@@ -918,6 +922,7 @@ GEM ...@@ -918,6 +922,7 @@ GEM
parslet (~> 1.5.0) parslet (~> 1.5.0)
toml-rb (1.0.0) toml-rb (1.0.0)
citrus (~> 3.0, > 3.0) citrus (~> 3.0, > 3.0)
trollop (2.1.3)
truncato (0.7.10) truncato (0.7.10)
htmlentities (~> 4.3.1) htmlentities (~> 4.3.1)
nokogiri (~> 1.8.0, >= 1.7.0) nokogiri (~> 1.8.0, >= 1.7.0)
...@@ -1144,6 +1149,7 @@ DEPENDENCIES ...@@ -1144,6 +1149,7 @@ DEPENDENCIES
rainbow (~> 2.2) rainbow (~> 2.2)
raindrops (~> 0.18) raindrops (~> 0.18)
rblineprof (~> 0.3.6) rblineprof (~> 0.3.6)
rbtrace (~> 0.4)
rdoc (~> 6.0) rdoc (~> 6.0)
re2 (~> 1.1.1) re2 (~> 1.1.1)
recaptcha (~> 3.0) recaptcha (~> 3.0)
......
---
title: Add rbtrace to Gemfile
merge_request: 20831
author:
type: other
# frozen_string_literal: true
require 'rbtrace' if ENV['ENABLE_RBTRACE']
...@@ -66,6 +66,19 @@ On CentOS: ...@@ -66,6 +66,19 @@ On CentOS:
sudo yum install gdb sudo yum install gdb
``` ```
### rbtrace
GitLab 11.2 ships with [rbtrace](https://github.com/tmm1/rbtrace), which
allows you to trace Ruby code, view all running threads, take memory dumps,
and more. However, this is not enabled by default. To enable it, define the
`ENABLE_RBTRACE` variable to the environment. For example, in Omnibus:
```ruby
gitlab_rails['env'] = {"ENABLE_RBTRACE" => "1"}
```
Then reconfigure the system and restart Unicorn and Sidekiq.
## Common Problems ## Common Problems
Many of the tips to diagnose issues below apply to many different situations. We'll use one Many of the tips to diagnose issues below apply to many different situations. We'll use one
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment