summaryrefslogtreecommitdiff
path: root/config/unicorn.rb.example
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2013-08-23 10:28:07 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2013-08-23 10:31:32 +0200
commit2b9d48ccd020a4ff62741118be94ab8d8f3b08b9 (patch)
tree72dcd89cc58d5132455b4adfc3045b2f82ad88e0 /config/unicorn.rb.example
parent21e3d848b464f8cabbbddb3d2d4e2b697d4476b0 (diff)
downloadgitlab-ce-2b9d48ccd020a4ff62741118be94ab8d8f3b08b9.tar.gz
Fix the `service gitlab restart` command
This commit addresses two related issues: - Sidekiq should shut down completely before we restart it; - If we restart unicorn with USR2 we need to kill the old master and worker processes.
Diffstat (limited to 'config/unicorn.rb.example')
-rw-r--r--config/unicorn.rb.example26
1 files changed, 13 insertions, 13 deletions
diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example
index e010de6d6a9..294d521b66e 100644
--- a/config/unicorn.rb.example
+++ b/config/unicorn.rb.example
@@ -64,19 +64,19 @@ before_fork do |server, worker|
# installations. It is not needed if your system can house
# twice as many worker_processes as you have configured.
#
- # # This allows a new master process to incrementally
- # # phase out the old master process with SIGTTOU to avoid a
- # # thundering herd (especially in the "preload_app false" case)
- # # when doing a transparent upgrade. The last worker spawned
- # # will then kill off the old master process with a SIGQUIT.
- # old_pid = "#{server.config[:pid]}.oldbin"
- # if old_pid != server.pid
- # begin
- # sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
- # Process.kill(sig, File.read(old_pid).to_i)
- # rescue Errno::ENOENT, Errno::ESRCH
- # end
- # end
+ # This allows a new master process to incrementally
+ # phase out the old master process with SIGTTOU to avoid a
+ # thundering herd (especially in the "preload_app false" case)
+ # when doing a transparent upgrade. The last worker spawned
+ # will then kill off the old master process with a SIGQUIT.
+ old_pid = "#{server.config[:pid]}.oldbin"
+ if old_pid != server.pid
+ begin
+ sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
+ Process.kill(sig, File.read(old_pid).to_i)
+ rescue Errno::ENOENT, Errno::ESRCH
+ end
+ end
#
# Throttle the master from forking too quickly by sleeping. Due
# to the implementation of standard Unix signal handlers, this