Hi, I''m wondering why SIGINT and SIGTERM both were chosen for the quick shutdown? I agree with SIGINT but not with SIGTERM. A lot of unix tools send SIGTERM as default (kill, runit among some) and it seems to be the standard way of telling a process to quit gracefully but not among Ruby people (there are a few other ruby processes behaving the same way). I just think it''s weird that the default command will exit without taking care of their current request. Also i''m not on the mailinglist so it would be great if you could cc mail@andreasfalk.se Regards, Andreas Falk _______________________________________________ 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
Andreas Falk <mail@andreasfalk.se> wrote:> I''m wondering why SIGINT and SIGTERM both were chosen for the quick > shutdown? I agree with SIGINT but not with SIGTERM. A lot of unix > tools send SIGTERM as default (kill, runit among some) and it seems to > be the standard way of telling a process to quit gracefully but not > among Ruby people (there are a few other ruby processes behaving the > same way). I just think it''s weird that the default command will exit > without taking care of their current request. > > Also i''m not on the mailinglist so it would be great if you could cc > mail@andreasfalk.seI think it''s weird, too. But that''s what nginx does, and I based most of the UI decisions on nginx (so it''s easy to reuse nginx scripts with unicorn). _______________________________________________ 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
On Thu, Apr 25, 2013 at 10:51 AM, Eric Wong <normalperson@yhbt.net> wrote:> Andreas Falk <mail@andreasfalk.se> wrote: >> I''m wondering why SIGINT and SIGTERM both were chosen for the quick >> shutdown? I agree with SIGINT but not with SIGTERM. A lot of unix >> tools send SIGTERM as default (kill, runit among some) and it seems to >> be the standard way of telling a process to quit gracefully but not >> among Ruby people (there are a few other ruby processes behaving the >> same way). I just think it''s weird that the default command will exit >> without taking care of their current request. >> >> Also i''m not on the mailinglist so it would be great if you could cc >> mail@andreasfalk.se > > I think it''s weird, too. But that''s what nginx does, and I based most > of the UI decisions on nginx (so it''s easy to reuse nginx scripts > with unicorn).Is it something you''d be willing to change? The developers behind resque reasoned in a similar way in regards to nginx but changed it after a while. You can read more about it here <https://github.com/resque/resque/issues/368> and in the referenced issues. The change i''d like to see is to preferably have SIGTERM and SIGQUIT swap places but at least move SIGTERM to do the same thing as SIGQUIT do now (graceful exit). I may be wrong but i feel that the change shouldn''t completely break anything (since it would still exit, just take a bit longer) and switching some signals around in the nginx scripts shouldn''t be that much work? Also some people are probably using SIGINT already and wouldn''t be affected. I think the benefit in the long run of being in line with the "standard" outweighs the hassle of converting a few scripts. Also perhaps with some luck the nginx developers will pick on the changes in other software and switch theirs around too! Thanks for a really great tool anyway! Andreas _______________________________________________ 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
Andreas Falk <mail@andreasfalk.se> wrote:> On Thu, Apr 25, 2013 at 10:51 AM, Eric Wong <normalperson@yhbt.net> wrote: > > Andreas Falk <mail@andreasfalk.se> wrote: > >> I''m wondering why SIGINT and SIGTERM both were chosen for the quick > >> shutdown? I agree with SIGINT but not with SIGTERM. A lot of unix > >> tools send SIGTERM as default (kill, runit among some) and it seems to > >> be the standard way of telling a process to quit gracefully but not > >> among Ruby people (there are a few other ruby processes behaving the > >> same way). I just think it''s weird that the default command will exit > >> without taking care of their current request. > >> > >> Also i''m not on the mailinglist so it would be great if you could cc > >> mail@andreasfalk.se > > > > I think it''s weird, too. But that''s what nginx does, and I based most > > of the UI decisions on nginx (so it''s easy to reuse nginx scripts > > with unicorn). > > Is it something you''d be willing to change?If nginx developers are willing to change this, definitely. Otherwise, at this point, I''m not certain what the ramifications of a change would be to existing users. Maybe an option would work, but too many options overwhelms people. With unicorn, I suppose having the following after_fork hook works: # Note: after_fork hook is run before the :QUIT handler is installed, # so we can''t use the result of trap(:QUIT) at this point: after_fork do |server,worker| trap(:TERM) { Process.kill(:QUIT, $$) } end If I had to do this all over again[1], graceful shutdown would be the _only_ option. [1] - I haven''t released a new web server for 2013... yet :) _______________________________________________ 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
On Thu, Apr 25, 2013 at 8:09 PM, Eric Wong <normalperson@yhbt.net> wrote:> If nginx developers are willing to change this, definitely.I guess I''ll go camp out among some nginx developers then.> If I had to do this all over again[1], graceful shutdown would be the > _only_ option. > > [1] - I haven''t released a new web server for 2013... yet :)Hehe, i hear you! Maybe a unicorn 5 or do you have any plans for something completely new :)? I guess i''ll have to wait and see. Thanks for the help! Andreas _______________________________________________ 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
Reasonably Related Threads
- Fwd: Maintaining capacity during deploys
- Detecting unicorn / defining after_fork after master startup
- Unicorn: UNIX+localhost/LAN-only Mongrel fork
- preload_app = true causing - ActiveModel::MissingAttributeError: missing attribute: some_attr
- Unicorn 3.3.1 "Too many open files" error in kgio_tryaccept