Re: keepalive in libpq using

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Pavel Golub <pavel(at)microolap(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: keepalive in libpq using
Date: 2010-07-07 13:04:13
Message-ID: AANLkTik2y4IYCtzWPqFb4wd5Ml7l_UoJKq9AEuLkSdAO@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 6, 2010 at 1:08 PM, Pavel Golub <pavel(at)microolap(dot)com> wrote:
> While I'm very excited about enabling keepalives in libpq, I want to
> know how can I use this functionality in my application?
>
> Let's imagine that I connect to a server with keepalives option, other
> options (keepalives_idle, keepalives_interval, keepalives_count) are
> used either. Then network goes down. So, how will I know that
> connection is dead? Any callback function? Or should I check PQstatus
> periodically?

I'm not sure, exactly. I think what'll happen is that if you're
trying to read data from the remote server, the connection will
eventually break instead of hanging forever, but I'm not exactly sure
what that'll look like at the libpq level. I'm not sure what effect
it'll have on an idle connection.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2010-07-07 13:20:01 Re: Keepalives win32
Previous Message Robert Haas 2010-07-07 12:57:11 Re: Partitioning syntax