Re: Keep-alive support - Mailing list pgsql-interfaces

From Tomasz Myrta
Subject Re: Keep-alive support
Date
Msg-id 456DEE3D.3020108@klaster.net
Whole thread Raw
In response to Keep-alive support  (Leandro Lucarella <llucarella@integratech.com.ar>)
Responses Re: Keep-alive support  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
List pgsql-interfaces
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


pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: Keep-alive support
Next
From: "Jeroen T. Vermeulen"
Date:
Subject: Re: Keep-alive support