pg.ddx.io  pgsql-hackers-win32@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Merlin Moncure <merlin.moncure@rcsonline.com>
Cc: pgsql-patches@postgresql.org
Cc: pgsql-hackers-win32@postgresql.org
Subject: Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Date: Mon, 12 Sep 2005 12:59:46 +1200
Message-ID: <4324D302.6080701@opencloud.com> (raw)
In-Reply-To: <26887.1126224143@sss.pgh.pa.us>
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>

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

Attachments:

pgsql-keepalives-noerror.txt (text/plain, 1.3K) download 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;

view thread (12+ messages)  latest in thread

Message-ID: <4324D302.6080701@opencloud.com>
Permalink:  ../4324D302.6080701@opencloud.com/
Also on:    postgresql.org/message-id/4324D302.6080701@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers-win32@postgresql.org
  Cc: oliver@opencloud.com, tgl@sss.pgh.pa.us, merlin.moncure@rcsonline.com, pgsql-patches@postgresql.org
  Subject: Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
  In-Reply-To: <4324D302.6080701@opencloud.com>
  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> <4324D302.6080701@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox