pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeroen T. Vermeulen <jtv@xs4all.nl>
To: Tomasz Myrta <jasiek@klaster.net>
Cc: Leandro Lucarella <llucarella@integratech.com.ar>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Keep-alive support
Date: Thu, 30 Nov 2006 13:33:03 +0700 (ICT)
Message-ID: <17164.125.24.223.202.1164868383.squirrel@webmail.xs4all.nl> (raw)
In-Reply-To: <456DEE3D.3020108@klaster.net>
References: <456DE433.8000407@integratech.com.ar>
	<456DEE3D.3020108@klaster.net>

On Thu, November 30, 2006 03:31, Tomasz Myrta wrote:

> I used keepalive the same way as you (reconfiguring socket directly) and
> I don't remember libpq trying to reconnect itself. I think it's a
> libpqxx's behaviour - I didn't use it, but it looks like it is called
> "reactivation".

That's right.  It's libpqxx, not libpq, that restores the connection.  (It
couldn't really be any other way because libpq doesn't have enough
information to know it's safe--you could be in the middle of a
transaction, or you could be losing a temp table).  Automatic reactivation
can also be disabled explicitly if you don't want it (or just *when* you
don't want it--e.g. when you're working with temp tables).

I do think that the long TCP timeouts are something that should be handled
at the lower levels.  We can't really do real keepalives, I guess, simply
because libpq is synchronous to the application.  But perhaps we could
demand that the server at least acknowledge a request in some way within a
particular time limit?  It'd have to be at the lowest level possible and
as "cheap" as possible, so it doesn't break when the server is merely very
busy.


Jeroen





view thread (6+ messages)  latest in thread

Message-ID: <17164.125.24.223.202.1164868383.squirrel@webmail.xs4all.nl>
Permalink:  ../17164.125.24.223.202.1164868383.squirrel@webmail.xs4all.nl/
Also on:    postgresql.org/message-id/17164.125.24.223.202.1164868383.squirrel@webmail.xs4all.nl

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jtv@xs4all.nl, jasiek@klaster.net, llucarella@integratech.com.ar
  Subject: Re: Keep-alive support
  In-Reply-To: <17164.125.24.223.202.1164868383.squirrel@webmail.xs4all.nl>

* 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