X-Original-To: pgsql-hackers-win32-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A0A75D6DAC; Sun, 11 Sep 2005 21:59:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10037-07; Mon, 12 Sep 2005 00:59:44 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id C194AD857A; Sun, 11 Sep 2005 21:59:45 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EEcfj-0000Oj-8p; Mon, 12 Sep 2005 12:59:47 +1200 Message-ID: <4324D302.6080701@opencloud.com> Date: Mon, 12 Sep 2005 12:59:46 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Merlin Moncure , pgsql-patches@postgresql.org, pgsql-hackers-win32@postgresql.org Subject: Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL References: <6EE64EF3AB31D5448D0007DD34EEB3417DD2C6@Herge.rcsinc.local> <4320C4BE.7010306@opencloud.com> <26590.1126221622@sss.pgh.pa.us> <4320CA2E.1000104@opencloud.com> <26710.1126222815@sss.pgh.pa.us> <4320CE22.4070408@opencloud.com> <26887.1126224143@sss.pgh.pa.us> In-Reply-To: <26887.1126224143@sss.pgh.pa.us> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------020807010000040500060901" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 required=5 tests=[AWL=0.008] X-Spam-Level: X-Archive-Number: 200509/23 X-Sequence-Number: 3389 This is a multi-part message in MIME format. --------------020807010000040500060901 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Tom Lane wrote: > So the postmaster-log message may be the best we can do ... > but I don't think we should drop the connection. Here's a patch to do that; it appears to work as intended on my Linux system. -O --------------020807010000040500060901 Content-Type: text/plain; name="pgsql-keepalives-noerror.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pgsql-keepalives-noerror.txt" Index: src/backend/libpq/pqcomm.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/libpq/pqcomm.c,v retrieving revision 1.178 diff -c -r1.178 pqcomm.c *** src/backend/libpq/pqcomm.c 30 Jul 2005 20:28:20 -0000 1.178 --- src/backend/libpq/pqcomm.c 12 Sep 2005 00:58:15 -0000 *************** *** 595,612 **** return STATUS_ERROR; } ! /* Set default keepalive parameters. This should also catch ! * misconfigurations (non-zero values when socket options aren't ! * supported) */ ! if (pq_setkeepalivesidle(tcp_keepalives_idle, port) != STATUS_OK) ! return STATUS_ERROR; ! ! if (pq_setkeepalivesinterval(tcp_keepalives_interval, port) != STATUS_OK) ! return STATUS_ERROR; ! ! if (pq_setkeepalivescount(tcp_keepalives_count, port) != STATUS_OK) ! return STATUS_ERROR; } return STATUS_OK; --- 595,607 ---- return STATUS_ERROR; } ! /* Set default keepalive parameters. We ignore misconfigurations ! * that cause errors -- they will be logged, but won't kill the ! * connection. */ ! pq_setkeepalivesidle(tcp_keepalives_idle, port); ! pq_setkeepalivesinterval(tcp_keepalives_interval, port); ! pq_setkeepalivescount(tcp_keepalives_count, port); } return STATUS_OK; --------------020807010000040500060901--