Re: get_controlfile() can leak fds in the backend
Joe Conway <mail@joeconway.com>
From: Joe Conway <mail@joeconway.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-02-28T21:09:32Z
Lists: pgsql-hackers
On 2/28/19 7:20 AM, Michael Paquier wrote: > On Thu, Feb 28, 2019 at 07:11:04AM -0500, Joe Conway wrote: >> Sure, will do. What are your thoughts on backpatching? This seems >> unlikely to be a practical concern in the field, so my inclination is a >> master only fix. > > I agree that this would unlikely become an issue as an error on the > control file would most likely be a PANIC when updating it, so fixing > only HEAD sounds fine to me. Thanks for asking! Committed and push that way. By the way, while looking at this, I noted at least a couple of places where OpenTransientFile() is being passed O_RDWR when the usage is pretty clearly intended to be read-only. For example at least two instances in slru.c -- SlruPhysicalReadPage() and SimpleLruDoesPhysicalPageExist(). Is it worth while searching for and fixing those instances? Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development
Commits
-
Tighten use of OpenTransientFile and CloseTransientFile
- 82a5649fb9db 12.0 landed
-
Make get_controlfile not leak file descriptors
- 4598a99cf22d 12.0 landed