Re: Fwd: libpq: indefinite block on poll during network problems

Martijn van Oosterhout <kleptog@svana.org>

From: Martijn van Oosterhout <kleptog@svana.org>
To: Dmitry Samonenko <shreddingwork@gmail.com>
Cc: pgsql-general@postgresql.org
Date: 2014-05-30T16:19:55Z
Lists: pgsql-general
On Fri, May 30, 2014 at 07:48:00PM +0400, Dmitry Samonenko wrote:
> > 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.
> >
> Do you mean PQsendQuery / PQisBusy / PQgetResult? Well, I wouldn't start
> this discussion if that was an option. Adopting async command processing
> would lead to starting client from scratch.

I don't think the suggestion is to move to async command processing. I
think the suggestion is to use those methods to make a
PGgetResultWithTimeout() that does what you want.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.
   -- Arthur Schopenhauer