Re: [HACKERS] Full socket send buffer prevents cancel, timeout

2008-10-27 Thread Tom Lane
"Stephen R. van den Berg" <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> "Stephen R. van den Berg" <[EMAIL PROTECTED]> writes: >>> What about simply closing the filedescriptor upon discovering a >>> non-empty sendbuffer upon timeout/querycancel? >> So in other words, convert any network glitch,

Re: [HACKERS] Full socket send buffer prevents cancel, timeout

2008-10-27 Thread Stephen R. van den Berg
Tom Lane wrote: >"Stephen R. van den Berg" <[EMAIL PROTECTED]> writes: >> What about simply closing the filedescriptor upon discovering a >> non-empty sendbuffer upon timeout/querycancel? >So in other words, convert any network glitch, no matter how small, >into an instant fatal error? The fact t

Re: [HACKERS] Full socket send buffer prevents cancel, timeout

2008-10-27 Thread Tom Lane
"Stephen R. van den Berg" <[EMAIL PROTECTED]> writes: > What about simply closing the filedescriptor upon discovering a > non-empty sendbuffer upon timeout/querycancel? So in other words, convert any network glitch, no matter how small, into an instant fatal error? regards

Re: [HACKERS] Full socket send buffer prevents cancel, timeout

2008-10-27 Thread Stephen R. van den Berg
Michael Fuhr wrote: >On Sat, Oct 25, 2008 at 12:36:24PM -0400, Tom Lane wrote: >> 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

Re: [HACKERS] Full socket send buffer prevents cancel, timeout

2008-10-25 Thread Michael Fuhr
On Sat, Oct 25, 2008 at 12:36:24PM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> 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 c

Re: [HACKERS] Full socket send buffer prevents cancel, timeout

2008-10-25 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > I've recently been investigating long-running statements that, > despite statement_timeout settings and pg_cancel_backend() attempts, > remain visible in pg_stat_activity and continue to hold locks. When > this happens, a process trace and a debugger show

[HACKERS] Full socket send buffer prevents cancel, timeout

2008-10-25 Thread Michael Fuhr
I've recently been investigating long-running statements that, despite statement_timeout settings and pg_cancel_backend() attempts, remain visible in pg_stat_activity and continue to hold locks. When this happens, a process trace and a debugger show that the backend is blocked at the send() in sec