pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: mah0x211@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18096: In edge-triggered epoll and kqueue, PQconsumeInput/PQisBusy are insufficient for correct async ops.
Date: Fri, 08 Sep 2023 10:33:11 -0400
Message-ID: <1876131.1694183591@sss.pgh.pa.us> (raw)
In-Reply-To: <18096-2bd930f8f132fb4e@postgresql.org>
References: <18096-2bd930f8f132fb4e@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> When processing asynchronous commands, I call the `PQconsumeInput` and
> `PQisBusy` functions to check if data has arrived, as shown below, but this
> does not work correctly in edge trigger mode for epoll and kqueue.

You have not really provided any evidence of a bug.  The contract
for PQconsumeInput is that it will consume *some* input if any
is available, not that it will consume *all* available input.
(I don't think there is much reason to try to change that.  In the
first place, there might not be enough buffer space, and in the
second place, even if it did consume all input, more might arrive
immediately after it looks.)

Without a self-contained test case, it's hard to be sure what is going
wrong for you; but my guess is that this is a bug in the way you are
checking for more available input rather than something libpq did
wrong.

> However, the `pqReadData()` function will not call the `pqsecure_read()`
> function until the `errno` is set to `EAGAIN` or `EWOULDBLOCK`,

Uh ... what?

			regards, tom lane





view thread (3+ messages)  latest in thread

Message-ID: <1876131.1694183591@sss.pgh.pa.us>
Permalink:  ../1876131.1694183591@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1876131.1694183591@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mah0x211@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18096: In edge-triggered epoll and kqueue, PQconsumeInput/PQisBusy are insufficient for correct async ops.
  In-Reply-To: <1876131.1694183591@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox