Re: SIGPIPE handling, take two.

From: Manfred Spraul <manfred(at)colorfullife(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: SIGPIPE handling, take two.
Date: 2003-11-11 17:22:45
Message-ID: 3FB11AE5.2060707@colorfullife.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:

>Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>
>
>>I think this is the patch I like.
>>
>>
>
>The #if coding is messy and unnecessary. You could do the test as per
>the non-POSIX variant using two calls of pqsignal(), and not have any
>system dependence here, nor a need for <signal.h>.
>
>
What about multithreaded apps?

old = pgsignal(SIPEPIPE, SIG_IGN);
** another thread calls sigaction(SIGPIPE,,);
pgsignal(SIGPIPE, old);

And the signal state is corrupted. What about extending pgsignal:
pgsignal(signo, SIG_ERR);
reads the current signal handler. I'll update my patch.

From your other mail:

>No, because this patch does not have any global effect on the signal
>handling. It might be unnecessary to check per-connection, but it
>doesn't hurt, and on grounds of cleanliness I'd prefer to avoid a global
>variable.
>
>
I agree - global state would require global synchronization.

--
Manfred

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-11-11 17:28:12 Re: SIGPIPE handling, take two.
Previous Message Tom Lane 2003-11-11 14:30:09 Re: SIGPIPE handling, take two.