Re: SIGPIPE handling

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Manfred Spraul <manfred(at)colorfullife(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: SIGPIPE handling
Date: 2003-11-16 18:03:25
Message-ID: 200311161803.hAGI3Pk11202@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Manfred Spraul <manfred(at)colorfullife(dot)com> writes:
> > But how should libpq notice that the caller handles sigpipe signals?
> > a) autodetection - if the sigpipe handler is not the default, then the
> > caller knows what he's doing.
> > b) a new PGsetsignalhandler() function.
> > c) an additional flag passed to PGconnectdb.
>
> > Tom preferred a). One problem is that the autodetection is not perfect:
> > an app could block the signal with sigprocmask, or it could install a
> > handler that doesn't expect sigpipe signals from within libpq.
> > I would prefer b), because it guarantees that the patch has no effect on
> > existing apps.
>
> I have no particular objection to (b) either, but IIRC there was some
> dispute about whether it sets a global or per-connection flag. ISTM
> that "I have a correct signal handler" is a global assertion (within one
> process) and so a global flag is appropriate. Someone else (Bruce?)
> didn't like that though.

I thought it should be global too, basically testing on the first
connection request.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-11-16 18:06:48 Re: [PATCHES] SRA Win32 sync() code
Previous Message Tom Lane 2003-11-16 18:03:19 Re: SIGPIPE handling