Dropped connection during COPY causes trouble

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Dropped connection during COPY causes trouble
Date: 1999-07-22 00:45:01
Message-ID: 2969.932604301@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Don't kill a psql client that's in the middle of a COPY IN operation.

With current sources, the connected backend fails to quit, but instead
goes into an infinite loop writing
pq_recvbuf: unexpected EOF on client connection
to stderr over and over.

If you have postmaster stderr directed to a disk file, as I believe
is standard procedure, by and by the disk the postmaster logfile
is on fills up, and people start getting very unhappy...

I assume this is fairly easily fixed, but do not have a fix right this
instant. It's probably my fault though --- I suppose it is an artifact
of the changes I made a couple months ago to prevent NOTICE messages
from coming out at inopportune times. (If the bug were in pre-6.5
releases I'm sure we'd have heard about it before.)

Will produce a back-patch for 6.5 when I have it, but wanted to give
people a heads-up now. Most embarrassing.

BTW, it occurs to me that the system ought to have provisions for
limiting the size of the logfile, rotating logfiles from time to
time, etc ... right now you cannot do those things easily except
by restarting the postmaster :-(. Even without this bug, a determined
attacker could create a DOS attack by doing EXPLAIN VERBOSE enough
times to run the postmaster logfile up to full disk. Bruce, I think
we need another TODO item:
* prevent postmaster logfile from growing without bound

regards, tom lane

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 1999-07-22 01:08:41 Re: [BUGS] Dropped connection during COPY causes trouble
Previous Message Unprivileged user 1999-07-21 16:58:01 General Bug Report: This message appears "malloc: cannot allocate memory"

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-07-22 01:08:41 Re: [BUGS] Dropped connection during COPY causes trouble
Previous Message Peter Mount 1999-07-21 22:17:36 Email to me