Re: [bug fix] psql \copy doesn't end if backend is killed - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [bug fix] psql \copy doesn't end if backend is killed
Date
Msg-id 32508.1392339331@sss.pgh.pa.us
Whole thread Raw
In response to [bug fix] psql \copy doesn't end if backend is killed  ("MauMau" <maumau307@gmail.com>)
Responses Re: [bug fix] psql \copy doesn't end if backend is killed  ("MauMau" <maumau307@gmail.com>)
List pgsql-hackers
"MauMau" <maumau307@gmail.com> writes:
> If the backend is terminated with SIGKILL while psql is running "\copy 
> table_name from file_name", the \copy didn't end forever.  I expected \copy 
> to be cancelled because the corresponding server process vanished.

I just noticed this CF entry pertaining to the same problem that Stephen
Frost reported a couple days ago:
http://www.postgresql.org/message-id/20140211205336.GU2921@tamriel.snowman.net

I believe it's been adequately fixed as of commits fa4440f516 and
b8f00a46bc, but if you'd test that those handle your problem cases,
I'd appreciate it.

> [Fix]
> If the message transmission fails in PQputCopyEnd(), switch 
> conn->asyncStatus back to PGASYNC_BUSY.

This patch seems inappropriate to me, because it will allow libpq to exit
the COPY IN state whether or not it still has a live connection.  If it
does, the backend will be in an inconsistent state and we'll have a mess.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Fabrízio de Royes Mello
Date:
Subject: Re: [PATCH] Store Extension Options
Next
From: Hiroshi Inoue
Date:
Subject: Re: narwhal and PGDLLIMPORT