From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Testing LISTEN/NOTIFY more effectively
Date: Sat, 27 Jul 2019 20:02:13 -0400
Message-ID: <20277.1564272133@sss.pgh.pa.us> (raw)
In-Reply-To: <20190727235105.7dgzj5vhaok547ut@alap3.anarazel.de>
References: <31304.1564246011@sss.pgh.pa.us>
<20190727174202.jiwr4jgp3x7gvp22@alap3.anarazel.de>
<5720.1564249986@sss.pgh.pa.us>
<29162.1564266052@sss.pgh.pa.us>
<20190727231826.g34yqkzj53ey46tl@alap3.anarazel.de>
<10166.1564270037@sss.pgh.pa.us>
<20190727235105.7dgzj5vhaok547ut@alap3.anarazel.de>
Andres Freund <andres@anarazel.de> writes:
> Polling for notices on the blocked connection before printing anything
> ought to practically be reliable. Theoretically I think it still allows
> for some reordering, e.g. because there was packet loss on one, but not
> the other connection.
As long as it's a local connection, packet loss shouldn't be a problem
;-). I'm slightly more worried about the case of more than one bufferful
of NOTICE messages: calling PQconsumeInput isn't entirely guaranteed to
absorb *all* available input. But for the cases we actually need to
deal with, I think probably the patch as I sent it is OK. We could
complicate matters by going around the loop extra time(s) to verify
that select() thinks no data is waiting, but I doubt it's worth the
complexity.
regards, tom lane
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, pgsql-hackers@lists.postgresql.org
Subject: Re: Testing LISTEN/NOTIFY more effectively
In-Reply-To: <20277.1564272133@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