pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Kellerer <shammat@gmx.net>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Is this a bug in pg_current_logfile() on Windows?
Date: Wed, 8 Jul 2020 19:12:40 -0400
Message-ID: <252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com> (raw)
In-Reply-To: <1733826.1594243608@sss.pgh.pa.us>
References: <412ae8da-76bb-640f-039a-f3513499e53d@gmx.net>
	<1716646.1594226496@sss.pgh.pa.us>
	<bb8f2c7f-2bee-35bd-d57e-62864e95bb89@gmx.net>
	<1733826.1594243608@sss.pgh.pa.us>


On 7/8/20 5:26 PM, Tom Lane wrote:
>
> However ... I put in a test case to try to expose this failure, and
> our Windows buildfarm critters remain perfectly happy.  So what's up
> with that?  After some digging around, I believe the reason is that
> PostgresNode::psql is stripping the \r from pg_current_logfile()'s
> result, here:
>
> 		$$stdout =~ s/\r//g if $TestLib::windows_os;
>
> I'm slightly tempted to extend the test case by verifying on the
> server side that the result ends in ".log" with no extra characters.
> More generally, I wonder if the above behavior is really a good idea.
> It seems to have been added in commit 33f3bbc6d as a hack to avoid
> having to think too hard about mingw's behavior, but now I wonder if
> it isn't masking other bugs too.  At the very least I think we ought
> to tighten the coding to
>
> 		$$stdout =~ s/\r\n/\n/g if $TestLib::windows_os;
>
> so that it won't strip carriage returns at random.
>

Seems reasonable. If we rip it out completely we'll have to find all the
places it breaks and fix them. And we'll almost certainly get new
breakage. If it's hiding a real bug we'll have to do that, but I'd be
reluctant unless there's actual proof.


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services






view thread (18+ messages)  latest in thread

Message-ID: <252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com>
Permalink:  ../252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com/
Also on:    postgresql.org/message-id/252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: andrew.dunstan@2ndquadrant.com, tgl@sss.pgh.pa.us, shammat@gmx.net, pgsql-hackers@lists.postgresql.org
  Subject: Re: Is this a bug in pg_current_logfile() on Windows?
  In-Reply-To: <252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com>
  References: <412ae8da-76bb-640f-039a-f3513499e53d@gmx.net> <1716646.1594226496@sss.pgh.pa.us> <bb8f2c7f-2bee-35bd-d57e-62864e95bb89@gmx.net> <1733826.1594243608@sss.pgh.pa.us> <252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com>

* 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