From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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,RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: archivist@yhbt.net Delivered-To: archivist@dcvr.yhbt.net Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by dcvr.yhbt.net (Postfix) with ESMTP id 9E76B2106F for ; Mon, 26 Sep 2011 01:58:19 +0000 (UTC) Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 2926A185837C; Sun, 25 Sep 2011 21:58:19 -0400 (EDT) X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id B0D14185837B for ; Sun, 25 Sep 2011 21:43:00 -0400 (EDT) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E00D11F457; Mon, 26 Sep 2011 01:42:59 +0000 (UTC) Date: Mon, 26 Sep 2011 01:42:59 +0000 From: Eric Wong To: unicorn list Subject: Re: Timeout callback Message-ID: <20110926014259.GB19028@dcvr.yhbt.net> References: <4D4841AA1FE04C98BF883BDE8B17741E@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4D4841AA1FE04C98BF883BDE8B17741E@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Alex Sharp wrote: > Would there be any support for a worker-level timeout callback, for > workers that get killed by the master process for violating the > Unicorn::Configurator.timeout setting? Something like this /cannot/ be done right. The unicorn timeout uses SIGKILL because SIGKILL is a last resort and not catchable/blockable/trappable in user space. (SIGSTOP is in the same boat as SIGKILL). > I'm thinking the method could be on the Unicorn::Configurator class, > something like ".at_timeout_exit". My thinking here is I want to be > able to invoke caller() and get a backtrace to figure out the code > that's resulting in timeouts. Getting a backtrace relies on Ruby being in a runnable state. If user space (and Ruby) is capable of accepting non-SIGKILL/SIGSTOP, you could already be using something along the lines of the Timeout module in Ruby stdlib, SystemTimeout, or the Rainbows::ThreadTimeout middleware. In other words, you can already use an application-level timeout (even around the entire app dispatch) if you could get a backtrace. _______________________________________________ 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