pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mark Dilger <hornschnorter@gmail.com>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Windows buildfarm members vs. new async-notify isolation test
Date: Tue, 03 Dec 2019 11:40:48 -0500
Message-ID: <13003.1575391248@sss.pgh.pa.us> (raw)
In-Reply-To: <362bca0b-1c1c-c760-ab19-b5d9a14c69ea@gmail.com>
References: <32745.1575303812@sss.pgh.pa.us>
	<7221b3b4-fc7f-404d-5cf6-830d3aa6800d@2ndQuadrant.com>
	<362bca0b-1c1c-c760-ab19-b5d9a14c69ea@gmail.com>

Mark Dilger <hornschnorter@gmail.com> writes:
> On 12/2/19 11:42 AM, Andrew Dunstan wrote:
>> On 12/2/19 11:23 AM, Tom Lane wrote:
>>> I'm a little baffled as to what this might be --- some sort of
>>> timing problem in our Windows signal emulation, perhaps?  But
>>> if so, why haven't we found it years ago?

> I would be curious to see if there is a race condition in
> src/test/isolation/isolationtester.c between the loop starting
> on line 820:
>    while ((res = PQgetResult(conn)))
>    {
>       ...
>    }
> and the attempt to consume input that might include NOTIFY
> messages on line 861:
>    PQconsumeInput(conn);

In principle, the issue should not be there, because commits
790026972 et al should have ensured that the NOTIFY protocol
message comes out before ReadyForQuery (and thus, libpq will
absorb it before PQgetResult will return NULL).  I think the
timing problem --- if that's what it is --- must be on the
backend side; somehow the backend is not processing the
inbound notify queue before it goes idle.

Hmm ... just looking at the code again, could it be that there's
no well-placed CHECK_FOR_INTERRUPTS?  Andrew, could you see if
injecting one in what 790026972 added to postgres.c helps?
That is,

                /*
                 * Also process incoming notifies, if any.  This is mostly to
                 * ensure stable behavior in tests: if any notifies were
                 * received during the just-finished transaction, they'll be
                 * seen by the client before ReadyForQuery is.
                 */
+               CHECK_FOR_INTERRUPTS();
                if (notifyInterruptPending)
                    ProcessNotifyInterrupt();


			regards, tom lane





view thread (27+ messages)  latest in thread

Message-ID: <13003.1575391248@sss.pgh.pa.us>
Permalink:  ../13003.1575391248@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13003.1575391248@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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hornschnorter@gmail.com, andrew.dunstan@2ndquadrant.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Windows buildfarm members vs. new async-notify isolation test
  In-Reply-To: <13003.1575391248@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