Re: Testing the return value of fclose() in the backend

Поиск
Список
Период
Сортировка
От Gavin Sherry
Тема Re: Testing the return value of fclose() in the backend
Дата
Msg-id Pine.LNX.4.21.0305311300230.13303-100000@linuxworld.com.au
обсуждение исходный текст
Ответ на Re: Testing the return value of fclose() in the backend  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
On Fri, 30 May 2003, Bruce Momjian wrote:

> Gavin Sherry wrote:
> > Hi all,
> > 
> > There are various places in the backend, such as FreeFile(), where the
> > return value of fclose() is not tested. Whilst we would often notice any
> > problems with writing to data files due to testing on fsync(), it could
> > affect things like COPY ... TO, CreateOptsFile() and more.
> > 
> > Are we catching these somewhere else I'm not seeing?
> 
> We are not checking fclose, probably because fclose failures are quite
> rare.  Should we be concerned?

fsync() errors are probably just as rare. The problem with long running
daemons not testing for fclose() failure is the problem caused by file
descriptor leakage. I recall that squid (another long running daemon) had
this problem due to the large number of file systems interactions they
undertake. The question is, of course, what to do in postgres if
fclose() returns an error? elog(WARNING)? Another fclose() call? Not sure
what squid did.

Gavin



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Compressing Fields?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Compressing Fields?