Pull Request For Timeout Handling

Eric Wong normalperson at yhbt.net
Tue Jan 22 23:22:15 UTC 2013

(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

> 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

I wrote about this on the usp.ruby list a while back:

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.

More information about the mongrel-unicorn mailing list