diff options
author | Eric Wong <e@80x24.org> | 2014-05-02 23:15:58 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-05-04 02:32:07 +0000 |
commit | 27ae210dde9228cfa96ea6b0f3a7e4047d3f70a4 (patch) | |
tree | 0ebab1db5910f4689ba635347d66c6d04d5eb3ae /lib/unicorn/http_server.rb | |
parent | 9c333bf0c7db34694b8b78c7f03dd2ce89e32890 (diff) | |
download | unicorn-27ae210dde9228cfa96ea6b0f3a7e4047d3f70a4.tar.gz |
When daemonizing, it is possible for the grandparent to be terminated by another process before the master can notify it. Do not abort the master in this case. This may fix the following issue: https://github.com/kostya/eye/issues/49 (which I was notified of privately via email)
Diffstat (limited to 'lib/unicorn/http_server.rb')
-rw-r--r-- | lib/unicorn/http_server.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index 21cb9a1..a0ca302 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -272,7 +272,11 @@ class Unicorn::HttpServer proc_name 'master' logger.info "master process ready" # test_exec.rb relies on this message if @ready_pipe - @ready_pipe.syswrite($$.to_s) + begin + @ready_pipe.syswrite($$.to_s) + rescue => e + logger.warn("grandparent died too soon?: #{e.message} (#{e.class})") + end @ready_pipe = @ready_pipe.close rescue nil end begin |