Re: Fwd: libpq: indefinite block on poll during network problems - Mailing list pgsql-general

From Tom Lane
Subject Re: Fwd: libpq: indefinite block on poll during network problems
Date
Msg-id 2388.1401458932@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fwd: libpq: indefinite block on poll during network problems  (Dmitry Samonenko <shreddingwork@gmail.com>)
Responses Re: Fwd: libpq: indefinite block on poll during network problems
List pgsql-general
Dmitry Samonenko <shreddingwork@gmail.com> writes:
> So, should I fill a bug report?

[ shrug... ] This is not a bug.  It might be a feature request, but
I doubt that it's a feature anybody would be interested in implementing.
Adding timeouts to libpq would mean adding hard-to-test (and therefore
easy-to-break) logic paths, in service of what seems like a very debatable
design decision.  It's really the business of the network stack to decide
when a TCP connection has been lost, not libpq.  And it's not exactly
clear what recovery action libpq should take if it were to decide the
connection had been lost first.

BTW, you might consider using libpq's nonblock mode to push the waiting
out to the application level, and then you could just decide when you've
waited too long for yourself.

            regards, tom lane


pgsql-general by date:

Previous
From: Martín Marqués
Date:
Subject: Re: Data Checksum feature and streaming replication
Next
From: CS_DBA
Date:
Subject: Replication failover on windows