Received: from maia.hub.org (maia-4.hub.org [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id AC55E6854FA for ; Wed, 19 May 2010 16:57:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 86081-04-3 for ; Wed, 19 May 2010 19:57:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from joeconway.com (wsip-72-214-29-243.sd.sd.cox.net [72.214.29.243]) by mail.postgresql.org (Postfix) with ESMTP id F3E97684A26 for ; Wed, 19 May 2010 15:41:50 -0300 (ADT) Received: from [209.226.93.226] (account jconway HELO jec-macbook-pro.local) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 9666281; Wed, 19 May 2010 11:41:48 -0700 Message-ID: <4BF430E5.1040503@joeconway.com> Date: Wed, 19 May 2010 11:41:41 -0700 From: Joseph Conway User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Magnus Hagander CC: Valentine Gogichashvili , pgsql-bugs Subject: Re: BUG #5465: dblink TCP connection hangs blocking translation from being terminated References: <201005190910.o4J9AT3A063957@wwwmaster.postgresql.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.918 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RDNS_DYNAMIC=0.982 X-Spam-Level: X-Archive-Number: 201005/141 X-Sequence-Number: 26803 Magnus Hagander wrote: > On Wed, May 19, 2010 at 5:10 AM, Valentine Gogichashvili > wrote: >> The following bug has been logged online: >> >> Bug reference: 5465 >> Logged by: Valentine Gogichashvili >> Email address: valgog@gmail.com >> PostgreSQL version: 8.2.1 >> Operating system: Red Hat 3.4.6-3 (kernel 2.6.9-42.0.3.ELsmp) >> Description: dblink TCP connection hangs blocking translation from >> being terminated >> Details: >> >> Hi all, >> >> we have an issue on our productive server. A stored procedure, that uses >> dblink to get some data from the remote database hangs not responding to >> kill signal and holds several locks on some tables as well as an advisory >> lock. So I have this transaction to be completed in order to have a >> possibility to operate the database normally. > > I believe this is a known issue in dblink, where it's not possible to > cancel it when it's waiting in the TCP layer in the kernel. > Unfortunately, there is no fix ATM - there was some work towards it > for 9.0 at one point, but I think this is actually the first real > bug-report on the issue... I thought the known issue was only on Windows though... Note that this is not dblink specific but rather libpq. >> How would it be possible to shutdown the DB in case this session process is >> not responding to normal kill signals? Will it hinder the database from >> shutting down normally? My previous experience with issuing immediate stops >> or killing with -9 had been quite catastrophic and I could not start the DB >> afterwards. What would you suggest in this case? > > kill -9 on a client will make the postmaster restart the whole > process, so yes, it's a very heavy operation. Can you grab the process with gdb and call elog() manually? Joe