Re: Issue with retry_count in socket.c and fix for the same

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: malcolm(dot)macleod(at)tshwanedje(dot)com, "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>, "Itnal, Prakash (NSN - IN/Bangalore)" <prakash(dot)itnal(at)nsn(dot)com>
Subject: Re: Issue with retry_count in socket.c and fix for the same
Date: 2014-05-27 14:34:33
Message-ID: 5384A279.3090709@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On 05/26/2014 07:42 PM, Malcolm MacLeod wrote:
> Just wanted to confirm that I have tracked this down as the cause for a
> freeze/crash in our software as well.
> I can get it to block forever on the select call just by
> disconnecting/reconnecting network on a client a few times while it is
> querying lots of data from the server.
> I've tested the original patch and it does fix the issue, would be great
> to see a final fix for this.

Hmm, the driver enables TCP keepalives by default, which should
eventually notice a broken connection. It can take a long time, though;
I believe the default on most systems is two hours. Unfortunately there
are no options in psqlODBC to change the defaults, but e.g. on Linux you
can change the system-wide default with the tcp_keepalive_time sysctl.

I think the missing feature here is to add psqlODBC configuration
variables similar to libpq's keepalives_idle, keepalives_interval and
keepalives_count. I'm not going to work on that myself, but patches are
welcome.

- Heikki

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Heikki Linnakangas 2014-05-27 14:41:30 Re: Problems using SQLFetch on prepared INSERT with RETURNING clause
Previous Message Heikki Linnakangas 2014-05-27 14:26:56 Re: Issue with retry_count in socket.c and fix for the same