Re: BUG #15105: OpenTransientFile() should be paired with CloseTransientFile() rather than close()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: bianpan2016@163.com, pgsql-bugs@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>
Date: 2018-04-11T03:30:24Z
Lists: pgsql-bugs
On Tue, Apr 10, 2018 at 06:40:43PM -0400, Tom Lane wrote:
> On closer inspection, such a cross-check wouldn't have helped find this
> particular mistake, because it was in an error exit path that's likely
> never been exercised by anybody, and certainly isn't hit in the regression
> tests.  Still, I think it'd be a good thing to add, and hence propose the
> attached patch.  (I've verified that the warning doesn't fire in "make
> check-world".)

Good idea.  +1 for your proposed patch.
--
Michael

Commits

  1. In AtEOXact_Files, complain if any files remain unclosed at commit.

  2. Fix incorrect close() call in dsm_impl_mmap().