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: AS33070 50.56.128.0/17 X-Spam-Status: No, score=1.3 required=5.0 tests=AWL,FREEMAIL_FROM,RDNS_NONE, T_DKIM_INVALID shortcircuit=no autolearn=no version=3.3.2 X-Original-To: archivist@yhbt.net Delivered-To: archivist@dcvr.yhbt.net Received: from rubyforge.org (unknown [50.56.192.79]) by dcvr.yhbt.net (Postfix) with ESMTP id 131D220285 for ; Sat, 7 Dec 2013 00:10:16 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id DB6DC26306F; Sat, 7 Dec 2013 00:10:16 +0000 (UTC) X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org X-Greylist: delayed 309 seconds by postgrey-1.31 at rubyforge; Sat, 07 Dec 2013 00:10:09 UTC Received: from mail-oa0-f44.google.com (mail-oa0-f44.google.com [209.85.219.44]) by rubyforge.org (Postfix) with ESMTP id E71C026306E for ; Sat, 7 Dec 2013 00:10:09 +0000 (UTC) Received: by mail-oa0-f44.google.com with SMTP id m1so1610720oag.17 for ; Fri, 06 Dec 2013 16:10:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=TDDNdz/03W1HgBTbLvxryom0eaEK2L+xZE6KVY/AZM0=; b=MGKaqCxkQPWW7o/5bR0NjdFx064rPJF/nfVUgesgbxei7dtGPQZco2f98zFqVgwpEu nNvv3cHfBAGyWvKULA7C23vbVnnj8yB2UHLWCJVEl+kPkk4qwUpT3VXPXPCz8jKQ1aas q2GpRkkuYP37mmuH9VozSqVSmdSPY5P5jE3M1mSGgop0+s42x6m7LAZcWSdeN9qhPJLA tlbSYk+iHmXOhpu9azFGW7SIVPVlF80q6qU+KUL5WEn7oP/3p1nO55PMPlWppPjjLs10 sJbBpL08s9Z0JyJsUBCmPGb08N9DpJCMdj31gLpSsxSgZEqS3uKacONCmRoAdH2odvRC 3Sbw== MIME-Version: 1.0 X-Received: by 10.182.74.137 with SMTP id t9mr2375996obv.79.1386374699183; Fri, 06 Dec 2013 16:04:59 -0800 (PST) Received: by 10.76.167.41 with HTTP; Fri, 6 Dec 2013 16:04:59 -0800 (PST) In-Reply-To: <20131206184849.GA27820@dcvr.yhbt.net> References: <20131206184849.GA27820@dcvr.yhbt.net> Date: Sat, 7 Dec 2013 11:04:59 +1100 Message-ID: Subject: Re: unblock function in pg messes up with unicorn From: Sam Saffron To: unicorn list 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 yeah, mysql appears to be using the default ubf which simply forces your thread to be scheduled https://github.com/brianmario/mysql2/blob/a9787cbb88f18d12f0b5c370c519d077ad68c862/ext/mysql2/result.c#L203 I think it would be cool to change unicorn to perform all the master / worker coordination via pipes, only caveat is that QUIT and USR1 on workers will still not work as expected if using the pg gem. I am not sure Something like trap(:QUIT, no_ubf: true) would fly with core but I can raise a ticket on redmine and see what people think. On Sat, Dec 7, 2013 at 5:48 AM, Eric Wong wrote: > Sam Saffron wrote: >> 1. Is this a pg bug? How could they even implement a ubf in such a way >> that it does not stop queries when signals are sent? The main issue is >> that without this Thread.kill will have to wait for queries to finish. > > No, not a pg bug. pg needs to account for the user hitting Ctrl-C and > wanting to cancel a query (oh-no-I-started-DELETE-without-WHERE!). > >> 2. Is this a ruby bug? should there be a more sophisticated protocol >> here? Should trap handlers inform the runtime that a ubf is not >> needed? > > I don't know. Something like: trap(:QUIT, no_ubf: true) { ... } ? > >> something else ? > > Also see http://mid.gmane.org/20131120094717.GA17836@dcvr.yhbt.net > > Btw, given the master <-> worker separation in unicorn, we can also > have the master talk to the worker through a pipe and avoid signals > between the two. > >> Similar issue exists in mysql afaik. > > I don't think the mysql2 gem currently interrupts running queries. > Not sure about the others. > _______________________________________________ > 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 _______________________________________________ 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