Re: Full socket send buffer prevents cancel, timeout - Mailing list pgsql-hackers

From Michael Fuhr
Subject Re: Full socket send buffer prevents cancel, timeout
Date
Msg-id 20081026023130.GA56881@winnie.fuhr.org
Whole thread Raw
In response to Re: Full socket send buffer prevents cancel, timeout  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Full socket send buffer prevents cancel, timeout
List pgsql-hackers
On Sat, Oct 25, 2008 at 12:36:24PM -0400, Tom Lane wrote:
> Michael Fuhr <mike@fuhr.org> writes:
> > If the write is interrupted by a timeout or cancel, can anything
> > be done here or elsewhere to abort the statement and release its
> > locks?
> 
> The best thing would really be to kill the client.

Unfortunately the people running the database don't have control
over the client.  They'd like to kill the connection at the database
end but we haven't yet found a reliable way to do that short of an
immediate shutdown, which interrupts service and can lead to a long
recovery.  Are we missing any other possibilities?

> The backend can't take it upon itself to interrupt the send, because
> that would result in loss of protocol message sync, and without
> knowing how many bytes got sent there's really no way to recover.
> The only escape from the backend side would be to abort the session ---
> and even that's a bit problematic since we'd probably try to issue an
> error message somewhere on the way out, which isn't going to work
> either if the send buffer is full.

Yeah, I've already explained those difficulties.  I was hoping that
discussion might generate ideas on how to deal with them.

-- 
Michael Fuhr


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Regression in IN( field, field, field ) performance
Next
From: "Robert Haas"
Date:
Subject: BufferAccessStrategy for bulk insert