BUG #2883: TCP Keep Alive not enabled even after setting it in postresql.conf

From: "Christopher Brian Jurado" <chris(dot)jurado(at)primesoft(dot)ph>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2883: TCP Keep Alive not enabled even after setting it in postresql.conf
Date: 2007-01-11 23:17:26
Message-ID: 200701112317.l0BNHQVg032951@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2883
Logged by: Christopher Brian Jurado
Email address: chris(dot)jurado(at)primesoft(dot)ph
PostgreSQL version: 8.1
Operating system: Windows 2000/XP
Description: TCP Keep Alive not enabled even after setting it in
postresql.conf
Details:

The TCP keepalives do not work or is not enabled.

For Windows, in order to control the keepalive settings, you have to add
some entries to its registry. But, its TCP keepalive is disabled by default.
It has to be enabled for the socket using the setsockopt() command.

Did you guys add the setsockopt() command to enable the SO_KEEPALIVE option?
could this setting be added in the postgresql.conf?

We are having touble with this because if a client's network connection
fails, and the client still has an active transaction with locks, those
locks are never released!

As a reference, here is the info about TCP Keepalive Messages on the
Microsoft Knowledgebase:

"TCP Keepalive Messages

A TCP keepalive packet is simply an ACK with the sequence number set to one
less than the current sequence number for the connection. A computer
receiving one of these ACKs should respond with an ACK for the current
sequence number. Keepalives can be used to verify that the computer at the
remote end of a connection is still available. TCP keepalives can be sent
once every KeepAliveTime (defaults to 7,200,000 milliseconds or two hours),
if no other data or higher level keepalives have been carried over the TCP
connection. If there is no response to a keepalive, it is repeated once
every KeepAliveInterval seconds. KeepAliveInterval defaults to one second.
NetBT connections, such as those used by many Microsoft networking
components, send NetBIOS keepalives more frequently, and so normally no TCP
keepalives will be sent on a NetBIOS connection. TCP keepalives are disabled
by default, but Windows Sockets programs may enable them using setsockopt().
"

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2007-01-12 00:38:33 Re: BUG #2882: jdbc driver: date returned from a stored proc is incorrect
Previous Message Ravi 2007-01-11 11:40:19 BUG #2882: jdbc driver: date returned from a stored proc is incorrect