pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomasz Myrta <jasiek@klaster.net>
To: Leandro Lucarella <llucarella@integratech.com.ar>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Keep-alive support
Date: Wed, 29 Nov 2006 21:31:57 +0100
Message-ID: <456DEE3D.3020108@klaster.net> (raw)
In-Reply-To: <456DE433.8000407@integratech.com.ar>
References: <456DE433.8000407@integratech.com.ar>

Leandro Lucarella napisal 2006-11-29 20:49:
> Is there any keep alive support in libpq? I'm not really using libpq 
> directly, I'm using libpqxx and there is no keep-alive support there, 
> so I'm trying to use TCP's own keep-alive support, but I have a 
> problem: libpq seems to reconnect the socket when the connection is lost.
<cut>
>  In the sleep time I unplug the network cable and monitor the TCP 
> connection using netstat -pano, and found all the TCP keep-alive 
> timers times out perfectly, closing the connection, but inmediatly I 
> see a new connection (and without the keep-alive parameters, so it 
> take forever to timeout again). So I guess libpq is re-opening the 
> socket. This is making my life a nightmare =)
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".

Regards,
Tomasz Myrta



view thread (6+ messages)  latest in thread

Message-ID: <456DEE3D.3020108@klaster.net>
Permalink:  ../456DEE3D.3020108@klaster.net/
Also on:    postgresql.org/message-id/456DEE3D.3020108@klaster.net

 · 

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: jasiek@klaster.net, llucarella@integratech.com.ar
  Subject: Re: Keep-alive support
  In-Reply-To: <456DEE3D.3020108@klaster.net>

* 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