From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,MSGID_FROM_MTA_HEADER, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: TTIN after WINCH Date: Thu, 15 Jul 2010 15:47:03 -0700 Message-ID: <20100715224703.GA32661@dcvr.yhbt.net> References: <4C3F8C9F.2090903@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1279234030 10940 80.91.229.12 (15 Jul 2010 22:47:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Jul 2010 22:47:10 +0000 (UTC) To: unicorn list Original-X-From: mongrel-unicorn-bounces@rubyforge.org Fri Jul 16 00:47:10 2010 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Content-Disposition: inline In-Reply-To: <4C3F8C9F.2090903@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:649 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OZXCv-0007kT-Mt for gclrug-mongrel-unicorn@m.gmane.org; Fri, 16 Jul 2010 00:47:09 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 1E4B21858374; Thu, 15 Jul 2010 18:47:09 -0400 (EDT) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id 400561858361 for ; Thu, 15 Jul 2010 18:47:04 -0400 (EDT) Received: from localhost (unknown [127.0.2.5]) by dcvr.yhbt.net (Postfix) with ESMTP id B23061F503; Thu, 15 Jul 2010 22:47:03 +0000 (UTC) Lawrence Pit 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