Re: TAP tests aren't using the magic words for Windows file access - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: TAP tests aren't using the magic words for Windows file access
Date
Msg-id 20191107033158.GH1768@paquier.xyz
Whole thread Raw
In response to Re: TAP tests aren't using the magic words for Windows file access  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: TAP tests aren't using the magic words for Windows file access  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
List pgsql-hackers
On Thu, Nov 07, 2019 at 11:13:32AM +1300, Thomas Munro wrote:
> Not a Windows or Perl person, but I see that you can redefine core
> functions with *CORE::GLOBAL::open = <replacement/wrapper>, if you
> wanted to make a version of open() that does that FILE_SHARE_READ
> dance.

FWIW, I would have gone with a solution like that, say within
TestLib.pm's INIT.  This ensures that any new future tests don't fall
into that trap again.

> Alternatively we could of course have our own xxx_open() function
> and use that everywhere, but that might be more distracting.

That does not sound really appealing.

> I'm a bit surprised that there doesn't seem to be a global switch
> thing you can set somewhere to make it do that anyway.  Doesn't
> everyone eventually figure out that all files really want to be
> shared?

I guess it depends on your requirements.  Looking around I can see
some mention about flock() but it does not solve the problem at the
time the fd is opened.  If this does not exist, then it seems to me
that we have very special requirements for our perl code, and that
these are not popular.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: [HACKERS] Block level parallel vacuum
Next
From: Michael Paquier
Date:
Subject: Re: Problem during Windows service start