Re: Keep-alive support

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: Leandro Lucarella <llucarella(at)integratech(dot)com(dot)ar>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Keep-alive support
Date: 2006-11-29 20:31:57
Message-ID: 456DEE3D.3020108@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2006-11-29 20:34:40 Re: small bug in to_char and TM prefix, in RC
Previous Message Tom Lane 2006-11-29 20:28:16 Re: small bug in to_char and TM prefix, in RC

Browse pgsql-interfaces by date

  From Date Subject
Next Message Jeroen T. Vermeulen 2006-11-30 06:33:03 Re: Keep-alive support
Previous Message Tom Lane 2006-11-29 20:18:37 Re: Keep-alive support