Skip to content
Snippets Groups Projects
Commit 0a40035c authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch 'sh-make-unicorn-work-rbtrace' into 'master'

Make rbtrace work under unicorn

See merge request gitlab-org/gitlab-ce!20892
parents cb2e0730 37748e44
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
# frozen_string_literal: true
require 'rbtrace' if ENV['ENABLE_RBTRACE']
Loading
Loading
@@ -8,6 +8,8 @@ Sidekiq.default_worker_options = { retry: 3 }
enable_json_logs = Gitlab.config.sidekiq.log_format == 'json'
 
Sidekiq.configure_server do |config|
require 'rbtrace' if ENV['ENABLE_RBTRACE']
config.redis = queues_config_hash
 
config.server_middleware do |chain|
Loading
Loading
Loading
Loading
@@ -124,6 +124,10 @@ before_fork do |server, worker|
end
 
after_fork do |server, worker|
# Unicorn clears out signals before it forks, so rbtrace won't work
# unless it is enabled after the fork.
require 'rbtrace' if ENV['ENABLE_RBTRACE']
# per-process listener ports for debugging/admin/migrations
# addr = "127.0.0.1:#{9293 + worker.nr}"
# server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true)
Loading
Loading
Loading
Loading
@@ -77,7 +77,12 @@ and more. However, this is not enabled by default. To enable it, define the
gitlab_rails['env'] = {"ENABLE_RBTRACE" => "1"}
```
 
Then reconfigure the system and restart Unicorn and Sidekiq.
Then reconfigure the system and restart Unicorn and Sidekiq. To run this
in Omnibus, run as root:
```ruby
/opt/gitlab/embedded/bin/ruby /opt/gitlab/embedded/bin/rbtrace
```
 
## Common Problems
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment