Re: TCP keepalive support for libpq

Поиск
Список
Период
Сортировка
От Andrew Chernow
Тема Re: TCP keepalive support for libpq
Дата
Msg-id 4B717262.6020407@esilo.com
обсуждение исходный текст
Ответ на TCP keepalive support for libpq  (Tollef Fog Heen <tollef.fog.heen@collabora.co.uk>)
Ответы Re: TCP keepalive support for libpq  (Fujii Masao <masao.fujii@gmail.com>)
Re: TCP keepalive support for libpq  (daveg <daveg@sonic.net>)
Список pgsql-hackers
Tollef Fog Heen wrote:
> (please Cc me on replies, I am not subscribed)
> 
> Hi,
> 
> libpq currently does not use TCP keepalives.  This is a problem in our
> case where we have some clients waiting for notifies and then the
> connection is dropped on the server side.  The client never gets the FIN
> and thinks the connection is up.  The attached patch unconditionally
> adds keepalives.  I chose unconditionally as this is what the server
> does.  We didn't need the ability to tune the timeouts, but that could
> be added with reasonable ease.

ISTM that the default behavior should be keep alives disabled, as it is 
now, and those wanting it can just set it in their apps:

setsockopt(PQsocket(conn), SOL_SOCKET, SO_KEEPALIVE, ...)

If you really want libpq to manage this, I think you need to expose the 
probe interval and timeouts.  There should be some platform checks as 
well.  Check out...

http://www.mail-archive.com/pgsql-hackers@postgresql.org/msg128603.html

-- 
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeroen Vermeulen
Дата:
Сообщение: Re: Avoiding bad prepared-statement plans.
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: About psycopg2 (by its author)