(moving to public list, since this pull request (and your email address)
was already public)
Daisuke Taniwaki <daisuketaniwaki at gmail.com>
wrote:> Hi,
>
> I mistakenly send pull request to the mirror on github.
For public patches/pull-requests, please use the public mailing list in
the future. See the HACKING doc, submission guidelines for unicorn are
based on those of git itself, NOT an interface some corporation gives
you.
> Could you consider to merge this change?
> I think we can have a chance to handle SIGINT to debug worker process
timeout.
>
> https://github.com/defunkt/unicorn/pull/4
Thanks for your interest, but I cannot accept for several reasons:
Logger is unsafe inside signal handlers. Signal handlers must be
reentrant, and logger only guarantees thread-safety (via Mutex or
Monitor).
I wrote about this on the usp.ruby list a while back:
http://mid.gmane.org/20120326222500.GA20806 at dcvr.yhbt.net
Additionally, using a blocking (even for 1s) timeout is bad for the
master process, since it cannot handle other signals in that period.
The timeout in unicorn is a last resort, applications should normally
manage their own timeouts. If a worker can respond to SIGINT, it is
capable of responding to Ruby-level timeouts. See Application_Timeouts
doc for details.