Re: Should we nonblocking open FIFO files in COPY?

From: Adam Lee <ali(at)pivotal(dot)io>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnakangas(at)pivotal(dot)io>, Daniel Gustafsson <dgustafsson(at)pivotal(dot)io>, Ming Li <mli(at)pivotal(dot)io>
Subject: Re: Should we nonblocking open FIFO files in COPY?
Date: 2017-12-27 02:18:03
Message-ID: 20171227021803.GI1335@rmbp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)pivotal(dot)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().

--
Adam Lee

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2017-12-27 03:06:44 Re: [HACKERS] Runtime Partition Pruning
Previous Message Vaishnavi Prabakaran 2017-12-27 01:58:28 [HACKERS] [PATCH] Tap test support for backup with tablespace mapping