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 993A444C217 for ; Fri, 6 Dec 2013 12:37:23 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id BF076263094; Fri, 6 Dec 2013 12:37:22 +0000 (UTC) X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org X-Greylist: delayed 456 seconds by postgrey-1.31 at rubyforge; Fri, 06 Dec 2013 12:37:18 UTC Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by rubyforge.org (Postfix) with ESMTP id ABAD5263094 for ; Fri, 6 Dec 2013 12:37:18 +0000 (UTC) Received: by mail-ob0-f169.google.com with SMTP id wm4so672296obc.28 for ; Fri, 06 Dec 2013 04:37:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=vnnytTiGVk52Yb7yeg0MCAHa07Hobav/xcAd3Q9OLBg=; b=feeNqBoRvsM1T1THsJenILmdLhgVvA4f4ZbA1ap/IT2deKGVEvWUMxd3dh/0asAkER 8CJyngrrcqTV9lHRFMEM3amvH3h/ESOkofRGovQaEjkkntv+ASJBpKySBET3k7CDFMJb Nm12S9cLFBnNO4oUrw980gf6l7wMiuXA40oLyNDe8g0pbzjFHhDD2770ErnaXeVEhart Dx3cVk753HyQeptev4NoluUCwaJppnyXrQNwtBahAaHvYnRbp98Q39xP6+C1Xm/swFC+ agZZ2jTM8i/3Xyd6v2p9krhaELFSSWVbF0zYikHomrsCvwAbnZ5kEopRphZpxU+MBeSu dtDg== MIME-Version: 1.0 X-Received: by 10.60.37.33 with SMTP id v1mr2337883oej.2.1386332978256; Fri, 06 Dec 2013 04:29:38 -0800 (PST) Received: by 10.76.167.41 with HTTP; Fri, 6 Dec 2013 04:29:38 -0800 (PST) Date: Fri, 6 Dec 2013 23:29:38 +1100 Message-ID: Subject: unblock function in pg messes up with unicorn From: Sam Saffron To: mongrel-unicorn@rubyforge.org 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 require 'pg' conn = PG.connect(dbname: 'meta') trap 'USR1' do puts "YAY" end Thread.new do sleep 0.1 Process.kill("USR1", Process.pid) end sleep 1 puts "HERE" Thread.new do sleep 0.1 Process.kill("USR1", Process.pid) end conn.exec("select pg_sleep(10)") sam@ubuntu:~/Source$ ruby test2.rb YAY HERE YAY test2.rb:27:in `exec': ERROR: canceling statement due to user request (PG::QueryCanceled) from test2.rb:27:in `
' this is the ubf defined inside pg. void ubf_cancel_running_command(void *c) { /* has no idea why it was interrupted, should it stop the query due to USR1 */ PGconn *conn = (PGconn*) c; PQrequestCancel(conn); } This leaves a bunch of questions: 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. 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? something else ? Similar issue exists in mysql afaik. _______________________________________________ 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