Re: 2pc leaks fds - Mailing list pgsql-hackers

From Andres Freund
Subject Re: 2pc leaks fds
Date
Msg-id 20200406071610.s4xd4c37wu5ds7vk@alap3.anarazel.de
Whole thread Raw
In response to Re: 2pc leaks fds  (Antonin Houska <ah@cybertec.at>)
List pgsql-hackers
Hi,

On 2020-04-06 09:12:32 +0200, Antonin Houska wrote:
> Andres Freund <andres@anarazel.de> wrote:
> 
> > > From what I can see, the error is that the code only bothers closing
> > > WALOpenSegment->seg when switching to a new segment, but we need also
> > > to close it when finishing the business in XLogReaderFree().
> > 
> > Yea, I came to the same conclusion and locally fixed it the same way
> > (except having the close a bit earlier in XLogReaderFree()).
> 
> It's still not quite clear to me why the problem starts to appear after
> 0dc8ead46.  This patch does not remove any close() call from XLogReaderFree().

Before that change the file was also kind of leaked, but would use the
same static variable to store the fd and thus close it.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: pg_stat_statements issue with parallel maintenance (Was Re: WALusage calculation patch)
Next
From: Masahiko Sawada
Date:
Subject: Re: pg_stat_statements issue with parallel maintenance (Was Re: WALusage calculation patch)