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

From Merlin Moncure
Subject Re: libpq: indefinite block on poll during network problems
Date
Msg-id CAHyXU0xYiTniq=i4cBHg8JSKWQ0VOJOFCkxn-uu-0KVdswtryg@mail.gmail.com
Whole thread Raw
In response to Re: libpq: indefinite block on poll during network problems  (Dmitry Samonenko <shreddingwork@gmail.com>)
List pgsql-general
On Fri, May 30, 2014 at 4:00 PM, Dmitry Samonenko
<shreddingwork@gmail.com> wrote:
>  I'm troubled with possible 'imperfection' of very simple, yet core feature
> - PQexec, which can lead to blocked applications. You believe that the
> problem is caused by client design flaw. Okay, fine. Is it possible to mark
> this potential problem with warning in official documentation?

That's not warranted here IMNSHO.   There is an asynchronous API for
dealing with these types of situations.  Given that the blocking
execution functions do not take a timeout parameter and depend on
unreliable facilities, unbounded execution time should be expected.

Writing robust libpq applications generally involves using the
asynchronous API.  It's better in just about every way except
easiness.

merlin


pgsql-general by date:

Previous
From: sramay
Date:
Subject: bytea Issue - Reg
Next
From: Adrian Klaver
Date:
Subject: Re: bytea Issue - Reg