Re: Followup comment for bug report 'postmaster ignores SIGPIPE' [was: Bug#255208: Would help with client aborts, too.]

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-bugs(at)postgresql(dot)org, Martin Pitt <martin(at)piware(dot)de>
Subject: Re: Followup comment for bug report 'postmaster ignores SIGPIPE' [was: Bug#255208: Would help with client aborts, too.]
Date: 2006-03-27 15:01:47
Message-ID: 20060327150147.GW80726@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Mar 27, 2006 at 09:50:38AM -0500, Tom Lane wrote:
> "Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> > On Sun, Mar 26, 2006 at 08:34:46PM -0500, Tom Lane wrote:
> >> The question is whether doing either one is really a material
> >> improvement, seeing that neither is going to provoke an abort
> >> until/unless the backend actually tries to write something to the client.
>
> > Is there a server equivalent to PQstatus? If there were one, couldn't
> > the server periodically ping the client?
>
> No, and do you really want the server stopping its processing of the
> query just to go see if the client is still alive? This would slow
> things down and introduce a whole new failure mode, ie, client doesn't
> answer ping fast enough so its session gets aborted.

I guess it depends on how things are setup. Something like the following
probably wouldn't pose a tremendous amount of overhead...

set alarm 10 seconds;
bool ping_sent;
on alarm:
if ping_sent then
call to see if a ping reply is waiting for us (would this just
sit in the network buffer, or would we actually get interrupted)
if no ping then
if timeout exceeded then
abort backend;
endif
else
set ping_sent = false;
endif
else
ping_client();
set ping_set = true;
endif

Of course, the proof would be in doing some performance testing...
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Zerolo 2006-03-28 04:27:38 Re: BUG #2360: Backup produces "ERROR: could not convert UTF8 character to ISO8859-1"
Previous Message Tom Lane 2006-03-27 14:50:38 Re: Followup comment for bug report 'postmaster ignores SIGPIPE' [was: Bug#255208: Would help with client aborts, too.]