Re: pgsql: Fix bogus loop logic in 013_crash_restart test's pump_until subr

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Fix bogus loop logic in 013_crash_restart test's pump_until subr
Date: 2018-08-13 00:06:09
Message-ID: CAEepm=0rtoT5NaMGShGUbeB0nW7_jDxqgJT4oEyfMU35z9Msqg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Mon, Aug 13, 2018 at 10:05 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Fix bogus loop logic in 013_crash_restart test's pump_until subroutine.
>
> The pump_nb() step might've already received the desired data, so we must
> check for that at the top of the loop not the bottom. Otherwise, the
> call to pump() will sit with nothing to do until the timeout elapses.
> pump_until then falls out with apparent success ... but the timeout has
> been used up, causing the next call of pump_until to report a timeout
> failure. I believe this explains the intermittent timeout failures
> we've seen in the buildfarm ever since this test went in. I was able
> to reproduce the problem on gaur semi-repeatably, and this appears to
> fix it.

Oh, thank you! Occasional failures fitting this description had been
vexing me for a while in the cfbot results.

--
Thomas Munro
http://www.enterprisedb.com

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Gierth 2018-08-13 01:07:54 pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321)
Previous Message Tom Lane 2018-08-12 22:46:06 pgsql: Revert "Distinguish printf-like functions that support %m from t