Re: libpq: indefinite block on poll during network problems

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Dmitry Samonenko <shreddingwork(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: libpq: indefinite block on poll during network problems
Date: 2014-06-03 20:08:38
Message-ID: CAHyXU0xYiTniq=i4cBHg8JSKWQ0VOJOFCkxn-uu-0KVdswtryg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, May 30, 2014 at 4:00 PM, Dmitry Samonenko
<shreddingwork(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-06-04 00:39:24 Re: bytea Issue - Reg
Previous Message sramay 2014-06-03 08:25:36 bytea Issue - Reg