Re: Should we nonblocking open FIFO files in COPY?

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Should we nonblocking open FIFO files in COPY?
Дата
Msg-id 20171227035147.GB5318@paquier.xyz
обсуждение исходный текст
Ответ на Re: Should we nonblocking open FIFO files in COPY?  (Adam Lee <ali@pivotal.io>)
Ответы Re: Should we nonblocking open FIFO files in COPY?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, Dec 27, 2017 at 10:18:03AM +0800, Adam Lee wrote:
> On Tue, Dec 26, 2017 at 11:48:58AM -0800, Robert Haas wrote:
> > On Thu, Dec 21, 2017 at 10:10 PM, Adam Lee <ali@pivotal.io> wrote:
> > > I have an issue that COPY from a FIFO, which has no writers, could not be
> > > canceled, because COPY invokes AllocateFile() -> fopen() -> blocking open().
> >
> > Hmm.  What about the case where we try to open a plain file that's on
> > an inaccessible filesystem, e.g. due to a disk failure?  Allowing
> > cancel to work just for FIFOs would be OK, I guess, but allowing it
> > for other open() calls that hang would be better.  I'm not sure if we
> > can make it work that way, but it would be nice if we could.
>
> That is doable, just stat() and check before open().

I think TOCTOU when I read such things.. The data folder is a trusted
environment but any patches doing things like that ought to be careful.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] [PATCH] Tap test support for backup with tablespacemapping
Следующее
От: Haribabu Kommi
Дата:
Сообщение: Re: [HACKERS] Pluggable storage