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: X-Spam-Status: No, score=-2.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: unicorn-public@bogomips.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 1FACD1FD6B; Thu, 24 Jul 2014 17:04:25 +0000 (UTC) Date: Thu, 24 Jul 2014 17:04:24 +0000 From: Eric Wong To: =?utf-8?Q?Br=C3=A1ulio?= Bhavamitra Cc: unicorn-public Subject: Re: Old unicorn workers still receives requests? Message-ID: <20140724170424.GA29938@dcvr.yhbt.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: BrĂ¡ulio Bhavamitra wrote: > Hello all, > > I would like to know if old unicorn still receives and process requests in > a QUIT signal is sent to the old master. During heavy traffic, yes, there's a chance due to the optimization in worker_loop (lib/unicorn/http_server.rb): # make the following bet: if we accepted clients this round, # we're probably reasonably busy, so avoid calling select() # and do a speculative non-blocking accept() on ready listeners # before we sleep again in select(). unless nr == 0 tmp = ready.dup redo end Note, "receives" requests isn't correct, workers "pull" requests from a central queue in the kernel.