| From: | Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Amit Kapila <amit(dot)kapila(at)huawei(dot)com>, 'PostgreSQL-development' <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Switching timeline over streaming replication |
| Date: | 2012-11-15 15:16:20 |
| Message-ID: | 50A50744.9050808@vmware.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 15.11.2012 16:55, Tom Lane wrote:
> Heikki Linnakangas<hlinnakangas(at)vmware(dot)com> writes:
>> This is a fairly general issue, actually. Looking around, I can see at
>> least two similar cases in existing code, with BasicOpenFile, where we
>> will leak file descriptors on error:
>
> Um, don't we automatically clean those up during transaction abort?
Not the ones allocated with PathNameOpenFile or BasicOpenFile. Files
allocated with AllocateFile() and OpenTemporaryFile() are cleaned up at
abort.
> If we don't, we ought to think about that, not about cluttering calling
> code with certain-to-be-inadequate cleanup in error cases.
Agreed. Cleaning up at end-of-xact won't help walsender or other
non-backend processes, though, because they don't do transactions. But a
top-level ResourceOwner that's reset in the sigsetjmp() cleanup routine
would work.
- Heikki
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Alvaro Herrera | 2012-11-15 15:19:06 | Re: [PATCH 02/14] Add support for a generic wal reading facility dubbed XLogReader |
| Previous Message | Andres Freund | 2012-11-15 15:12:14 | Re: [PATCH 02/14] Add support for a generic wal reading facility dubbed XLogReader |