unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* TTIN after WINCH
@ 2010-07-15 22:33 Lawrence Pit
  2010-07-15 22:47 ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Lawrence Pit @ 2010-07-15 22:33 UTC (permalink / raw)
  To: unicorn list

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 )



Cheers,
Lawrence
_______________________________________________
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


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

* Re: TTIN after WINCH
  2010-07-15 22:33 TTIN after WINCH Lawrence Pit
@ 2010-07-15 22:47 ` Eric Wong
  2010-07-16  0:54   ` Lawrence Pit
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Wong @ 2010-07-15 22:47 UTC (permalink / raw)
  To: unicorn list

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


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

* Re: TTIN after WINCH
  2010-07-15 22:47 ` Eric Wong
@ 2010-07-16  0:54   ` Lawrence Pit
  2010-07-16  8:57     ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Lawrence Pit @ 2010-07-16  0:54 UTC (permalink / raw)
  To: unicorn list

Hi Eric,

Confirmed. Works for me.


Lawrence
>> 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
>   

_______________________________________________
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


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

* Re: TTIN after WINCH
  2010-07-16  0:54   ` Lawrence Pit
@ 2010-07-16  8:57     ` Eric Wong
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2010-07-16  8:57 UTC (permalink / raw)
  To: unicorn list

Lawrence Pit <lawrence.pit@gmail.com> wrote:
> Hi Eric,
>
> Confirmed. Works for me.

Thanks Lawrence, patch and test pushed up to unicorn.git

-- 
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


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

end of thread, other threads:[~2010-07-16  9:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-15 22:33 TTIN after WINCH Lawrence Pit
2010-07-15 22:47 ` Eric Wong
2010-07-16  0:54   ` Lawrence Pit
2010-07-16  8:57     ` 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).