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