unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: TTIN after WINCH
Date: Thu, 15 Jul 2010 15:47:03 -0700	[thread overview]
Message-ID: <20100715224703.GA32661@dcvr.yhbt.net> (raw)
In-Reply-To: <4C3F8C9F.2090903@gmail.com>

Lawrence Pit <lawrence.pit@gmail.com> wrote:
> Hi Eric,
>
> Not that it really matters to me, but I thought I let you know, just in  
> case you think it does matter: after sending a WINCH  should you decide  
> to send TTINs then that has no effect.  ( whereas if you dropped slowly  
> by sending TTOUs, then when it reaches 0 workers you can still send TTINs 
> )

Hi Lawrence, thanks for noticing this.  Apparently nobody did before :)
The following patch *should* work (untested).

I'll write a proper test case later today if nobody beats me to it.

diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index c231a4d..8f490bb 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -423,10 +423,12 @@ module Unicorn
               respawn = false
               logger.info "gracefully stopping all workers"
               kill_each_worker(:QUIT)
+              self.worker_processes = 0
             else
               logger.info "SIGWINCH ignored because we're not daemonized"
             end
           when :TTIN
+            respawn = true
             self.worker_processes += 1
           when :TTOU
             self.worker_processes -= 1 if self.worker_processes > 0
-- 
Eric Wong
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


  reply	other threads:[~2010-07-15 22:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-15 22:33 TTIN after WINCH Lawrence Pit
2010-07-15 22:47 ` Eric Wong [this message]
2010-07-16  0:54   ` Lawrence Pit
2010-07-16  8:57     ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100715224703.GA32661@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).