Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WPVPu-0001S3-Nb for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Mar 2014 11:09:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WPVPt-0003uN-WE for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Mar 2014 11:09:14 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WPVPt-0003uH-3g for pgsql-bugs@postgresql.org; Mon, 17 Mar 2014 11:09:13 +0000 Received: from mail-ee0-x232.google.com ([2a00:1450:4013:c00::232]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WPVPl-0006MH-HK for pgsql-bugs@postgresql.org; Mon, 17 Mar 2014 11:09:12 +0000 Received: by mail-ee0-f50.google.com with SMTP id c13so4056303eek.9 for ; Mon, 17 Mar 2014 04:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding:content-type; bh=F67+aLenlup4EkDd6R6zIgGldCcdelycGHqVhl88fZU=; b=uCi0otE4ca20sd7UPhOiuBjK4OX9wbZsp8G97ehKYzQqPNrQ+wlYwpFyY8c47IaiVO gaNfhd253ox4TaMwKunaMYR49iFs0MZxprkPBGx2vyOSTSAB8PmBU4+VuxvXgGGFTlw5 vGk6JblaBk353kNR+YtN3LufveosOD7Ysb9rKS9ac2pj/M9oib6lKLy/blnyCMyWQqau +2uk4fwHvADedjf2HOC1uUERoM4LZP0Bt2nYgkNJlbVgq2s6q2huARApYC0qPrWWTTSO OADs/FkZ7Yl/cyC/gcES6a1u3pYJ0vnticGM1aL+3Cnrjwn075/FPa23Jzqf6FwzY4b0 awfA== X-Received: by 10.15.41.140 with SMTP id s12mr23226421eev.4.1395054543784; Mon, 17 Mar 2014 04:09:03 -0700 (PDT) Received: from shu.localnet ([89.38.174.207]) by mx.google.com with ESMTPSA id j41sm38816183eeg.10.2014.03.17.04.09.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 04:09:03 -0700 (PDT) From: Robert Voinea To: Tom Lane Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #5465: dblink TCP connection hangs blocking translation from being terminated Date: Mon, 17 Mar 2014 13:09:20 +0200 Message-ID: <6245413.JIiidGyzFj@shu> User-Agent: KMail/4.11.1 (Linux/3.10.12-031012-generic; KDE/4.11.1; i686; ; ) In-Reply-To: <3110.1394804722@sss.pgh.pa.us> References: <10183969.312fJvI1H2@shu> <3110.1394804722@sss.pgh.pa.us> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" X-Pg-Spam-Score: -0.9 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi On Friday 14 March 2014 09:45:22 Tom Lane wrote: > Robert Voinea writes: > > In our setup, we make use extensively of dblink. > > Due to the fact that some queries take some time to complete and that the > > link is over the internet, sometime the server process (the transaction > > that runs the dblink queries) hangs when the link goes down, keeping > > locks on several records plus some advisory locks and thus freezing the > > whole (most of) the database. > > > > What I have found is this bug, that is remarkably similar (if not > > identical) with what we are experiencing. > > http://postgresql.1045698.n5.nabble.com/BUG-5465-dblink-TCP-connection-han > > gs-blocking-translation-from-being-terminated-td2132419.html#a2132420 > That does not sound like a Postgres bug to me. What you are unhappy about > is that the kernel isn't timing out a lost TCP connection more quickly. > The default timeout is long (>1 hour probably), but that's required by > Internet standards. The appropriate fix for this is to use aggressive > keepalive parameters on the connection. You can set libpq's keepalive > parameters in the connection string given to dblink. > > regards, tom lane I seem to have missed those parameters... and the fact that you actually need keep-alive on both client AND server, not only on the server. Thank you! -- Robert Voinea Software Engineer +4 0740 467 262 Don't take life too seriously. You'll never get out of it alive. (Elbert Hubbard) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs