From: | Magnus Hagander <magnus(at)hagander(dot)net> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | Pavel Golub <pavel(at)gf(dot)microolap(dot)com>, Pavel Golub <pavel(at)microolap(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: keepalive in libpq using |
Date: | 2010-07-08 08:27:04 |
Message-ID: | AANLkTimcKw2eC1jqQadfj83DRhn9KXECLJMKIMjw3nlV@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Jul 8, 2010 at 10:23, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Thu, Jul 8, 2010 at 4:57 PM, Pavel Golub <pavel(at)microolap(dot)com> wrote:
>> Sounds good for me. My customer proposed such a scenario:
>>
>> I have opened connection to database server (ver 8.4.3) through the
>> SSH tunnel. This tunnel is created by external program "PUTTY". My PC running Application
>> is connected to the ETH switch and server is connected to another port of the switch. So, when
>> I disconnect server from the switch, my PC is still online (I mean ETH port have the link). So, my
>> local side of the SSH tunnel is still alive, but remote side is down... So no connection to server
>> is possible at this moment. But in this scenario, when I do something like this:
>>
>> PQExec(...);
>>
>> Application stay locked on this command. Looks like client is still waiting answer from the server in
>> the case the TCP connection is still alive, even if Server is not accessible.
>>
>> The question is: Can this situation be solved with keealives?
>
> AFAIK, keepalive works only if there is no un-Acked data pending.
> If network goes down before sending query to server (i.e., calling
> PQexec), the ACK for the query doesn't arrive, so you cannot detect
> the disconnection via keepalive while waiting for the result of the
> query. OTOH, if network goes down after sending query, keepalive
> would make you detect the disconnection.
In this scenario, wouldn't it work if the *ssh connection* had
keepalives enabled though? Then that one should tear down, which in
turn would send a clear signal to libpq the connection is gone.
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2010-07-08 08:52:21 | Re: patch: preload dictionary new version |
Previous Message | Fujii Masao | 2010-07-08 08:23:48 | Re: keepalive in libpq using |