Re: 8.4: COPY continues after client disconnects - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: 8.4: COPY continues after client disconnects
Date
Msg-id 5139C5C0.5070305@vmware.com
Whole thread Raw
In response to 8.4: COPY continues after client disconnects  (Jon Nelson <jnelson+pgsql@jamponi.net>)
List pgsql-bugs
On 01.03.2013 17:15, Jon Nelson wrote:
> Using PostgreSQL 8.4.13 on ScientificLinux 6.3 (x86_64), I noticed
> that a pg_dump ran out of (local) disk space.
> However, the server was still using CPU and disk resources.  An strace
> clearly showed this pattern:
>
> read(....) = 8192
> sendto(...) = -1 EPIPE
> -- SIGPIPE (Broken pipe) @ ....
>
> The server does detect the broken pipe. It logs the following messages:
>
> 637 LOG:  08006: could not send data to client: Connection reset by peer
> 638 LOCATION:  internal_flush, pqcomm.c:1108
> 639 STATEMENT:  COPY ... to stdout;
> 640 LOG:  08006: could not send data to client: Broken pipe
> 641 LOCATION:  internal_flush, pqcomm.c:1108
> 642 STATEMENT:  COPY ... to stdout;

This was fixed in version 9.2. Per release notes:

>     Cancel the running query if the client gets disconnected (Florian Pflug)
>
>     If the backend detects loss of client connection during a query, it will now cancel the query rather than
attemptingto finish it. 

COPY counts as a "running query".

--
- Heikki

pgsql-bugs by date:

Previous
From: Josh Kupershmidt
Date:
Subject: Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist
Next
From: mv.gonzalez@cir.es
Date:
Subject: BUG #7924: Trigger update function don't take correct values