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: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-1.2 required=3.0 tests=AWL,BAYES_00,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: yahns-public@yhbt.net Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E461B200F8 for ; Wed, 23 Sep 2015 09:11:12 +0000 (UTC) Received: by lahh2 with SMTP id h2so18441045lah.0 for ; Wed, 23 Sep 2015 02:11:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=TkF77pLxRvXxTUhZXcqx9W3mAtGHLwbCwq45gePiU2Y=; b=M9VzvHcVsXil2/GNDBhKQyqqmkikcxDJXg+fPlwJfqgBy9+sT4zB386jXgbOlzlgt+ I5nLuPZz6RgRovJ0E+KC/5RdMk6DDYVdE9olV5q3egM7sPbtGY5szdubbrJ/0C3c7N1q zW6uv8OM3NOKc2XUWCtR9G1UVtrsBQERnNnnlB7sNqlyl9m1bngXqy0fTHNOtOVjqd2B efzzmpN7SAjnqGmBwEoqE4CTz7JSYKc5I9U4pK+MCNuydFG2G8A30R9PY9O2HgmniIcD LMYBhNXRtBqIlKrGvElN5k0gK1GAAOeh07ENU30nokuf8D39XyFQegu9RivVXvtRLQcl ZQfA== X-Gm-Message-State: ALoCoQnamA2Wnw2P5uDObDqPzDr8pIxu/fAjJMfnWocMlr8imH6BDQ/tofEF3gQSjGLbwhymvzpV X-Received: by 10.112.161.137 with SMTP id xs9mr11217679lbb.4.1442999470976; Wed, 23 Sep 2015 02:11:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.73.38 with HTTP; Wed, 23 Sep 2015 02:10:41 -0700 (PDT) In-Reply-To: <20150923083025.GA22196@dcvr.yhbt.net> References: <20150923080504.GA19141@dcvr.yhbt.net> <20150923083025.GA22196@dcvr.yhbt.net> From: "Lin Jen-Shin (godfat)" Date: Wed, 23 Sep 2015 17:10:41 +0800 Message-ID: Subject: Re: -1 shutdown_timeout? To: Eric Wong Cc: yahns-public@yhbt.net Content-Type: text/plain; charset=UTF-8 List-Id: On Wed, Sep 23, 2015 at 4:30 PM, Eric Wong wrote: > "Lin Jen-Shin (godfat)" wrote: >> However instead of setting shutdown_timeout, I think I would probably >> need to make the application know that the server is shutting down, >> and stop right there instead of waiting for full 60 seconds. >> >> Not sure if I could do this without talking to yahns directly... > > This is a Rack app? I really don't want to introduce custom APIs for > this which would lock Rack users down to yahns. Yes this is a Rack app. I totally understand locking down to a specific webserver would not be so good, but sometimes I really want to make the best tweak so I'm personally ok with some specific configuration, especially given that I realized switching to a different server could mean some other configuration should be changed as well. The most recent example is database connection pool size. With a threading server, I could set the size to a very large number, but for a forking server like Unicorn, the size should be much lower. So to switch servers, we already need to make a few changes accordingly. (detecting would be even more works :() > I suppose you could chain signal handlers, though: > > orig_quit = nil > orig_quit = trap(:QUIT) do > app_specific_quit > orig_quit.call > end > > (Ditto for TERM/INT, totally untested) Just tried it, but not sure where to put this. With preload=true, yahns is trapping later than the application. Maybe I should just set it to false since we're not forking anyway...