Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-07-29 04:12:34 +0300
committerStan Hu <stanhu@gmail.com>2018-07-30 18:12:45 +0300
commit820923664ddf353533892f0af21ed3822508a655 (patch)
tree6d9d02057c17bd9e4655bcf5f920543413a56365 /config/unicorn.rb.example
parent036c6db81362e3eff84eefcdb8c1e72bb79ab77c (diff)
Make rbtrace work under unicorn
The Unicorn master resets any signal handlers and prevents rbtrace from working properly as a result. Move the `require 'rbtrace'` call to the Unicorn `after_fork` block and keep the initializer only for Sidekiq.
Diffstat (limited to 'config/unicorn.rb.example')
-rw-r--r--config/unicorn.rb.example4
1 files changed, 4 insertions, 0 deletions
diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example
index 220a0191160..8f2d842e5b6 100644
--- a/config/unicorn.rb.example
+++ b/config/unicorn.rb.example
@@ -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)