unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [RFC/PATCH] http_server: handle premature grandparent death
@ 2014-05-02 23:15 Eric Wong
  2014-05-04  2:33 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2014-05-02 23:15 UTC (permalink / raw)
  To: mongrel-unicorn, unicorn-public

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)
---
 Will push and tag 4.8.3 this weekend (along with mailing list change).

 lib/unicorn/http_server.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 @@ def join
     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
-- 
Eric Wong

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC/PATCH] http_server: handle premature grandparent death
  2014-05-02 23:15 [RFC/PATCH] http_server: handle premature grandparent death Eric Wong
@ 2014-05-04  2:33 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2014-05-04  2:33 UTC (permalink / raw)
  To: mongrel-unicorn, unicorn-public

Eric Wong <e@80x24.org> wrote:
> This may fix the following issue:
> 
> 	https://github.com/kostya/eye/issues/49
> 
> (which I was notified of privately via email)

Confirmed to be the case privately.  Pushed.

>  Will push and tag 4.8.3 this weekend (along with mailing list change).

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-04  2:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-02 23:15 [RFC/PATCH] http_server: handle premature grandparent death Eric Wong
2014-05-04  2:33 ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).