diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-08-19 22:13:04 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-08-19 22:13:04 +0000 |
commit | 8de6ab371c1623669b86a5dfa8703c8fd539011f (patch) | |
tree | d269b8c3032098db82e66dae5316e6f510bfb3f1 /lib/unicorn/http_server.rb | |
parent | f8b22397ca395a9173d391e8699d539503707792 (diff) | |
download | unicorn-8de6ab371c1623669b86a5dfa8703c8fd539011f.tar.gz |
The signal handler from the master is still active and will push the pending signal to SIG_QUEUE if a worker receives a signal immediately after forking.
Diffstat (limited to 'lib/unicorn/http_server.rb')
-rw-r--r-- | lib/unicorn/http_server.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index aa8212e..4f516c9 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -549,6 +549,7 @@ class Unicorn::HttpServer def init_worker_process(worker) # we'll re-trap :QUIT later for graceful shutdown iff we accept clients EXIT_SIGS.each { |sig| trap(sig) { exit!(0) } } + exit!(0) if (SIG_QUEUE & EXIT_SIGS)[0] WORKER_QUEUE_SIGS.each { |sig| trap(sig, nil) } trap(:CHLD, 'DEFAULT') SIG_QUEUE.clear |