Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id ABC049FB272 for ; Fri, 13 Oct 2006 12:31:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 04475-03-3 for ; Fri, 13 Oct 2006 12:31:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 7A7389FA4CF for ; Fri, 13 Oct 2006 12:31:09 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (84-72-188-217.dclient.hispeed.ch [84.72.188.217]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 206BA65977; Fri, 13 Oct 2006 17:33:34 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 169F318148BBF; Fri, 13 Oct 2006 17:31:03 +0200 (CEST) Message-ID: <452FB136.3050605@logix-tt.com> Date: Fri, 13 Oct 2006 17:31:02 +0200 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.7 (X11/20060927) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Cc: PostGIS Development Discussion Subject: Re: "Hanging Connection" blocks access to table (JBossMQ) References: <13679.1160594122@sss.pgh.pa.us> <452F7E19.5020800@logix-tt.com> <29655.1160750114@sss.pgh.pa.us> In-Reply-To: <29655.1160750114@sss.pgh.pa.us> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.344 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, SARE_MILLIONSOF X-Spam-Level: X-Archive-Number: 200610/91 X-Sequence-Number: 15974 Hi, Tom, Tom Lane wrote: >> Is there any possibility that we make a backend realize this SIGIO (or >> whatever it gets) when the connection is closed? > I don't think it'd be a net win to add cycles to every query to check > the connection every so often. The SIGIO could set a flag variable via the interrupt handler, and then the backend could check that variable in a few, selected places. This should keep the overhead pretty low. And when the connection is low, there really is no point in continuing to work on the current query. >> The same is for very long running C-Code functions (like PostGIS >> geomUnion() on geometries with millions of vertices), those also tend to >> block the backend for long times, without any possibility to kill it >> except SIGKILL. > > That's the fault of the C code ... it should be doing > CHECK_FOR_INTERRUPTS periodically in any long-running loops. The problem is that most of those long-running functions are in 3rd-party libs like GEOS and ProJ, which are basically only wrapped by PostGIS, so it won't be easy to sprinkle them with CHECK_FOR_INTERRUPTS. I suspect that plR might suffer from the same problem. So we'll have to live with this. Thanks, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org