Re: libpq and psql not on same page about SIGPIPE

From: Manfred Spraul <manfred(at)colorfullife(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: libpq and psql not on same page about SIGPIPE
Date: 2004-12-01 06:52:42
Message-ID: 41AD6A3A.1040004@colorfullife.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:

>Comments? This seems like our only solution.
>
>
>
This would be a transparent solution. Another approach would be:
- Use the old 7.3 approach by default. This means perfect backward
compatibility for single-threaded apps and broken multithreaded apps.
- Add a new PQinitDB(int disableSigpipeHandler) initialization function.
Document that multithreaded apps must call the function with
disableSigpipeHandle=1 and handle SIGPIPE for libpq. Perhaps with a
reference implementation in libpq (i.e. a sigpipeMode with 0 for old
approach, 1 for do nothing, 2 for install our own handler).

It would prefer that approach:
It means that the multithreaded libpq apps must be updated [are there
any?], but the solution is simpler and less fragile than calling 4
signal handling function in a row to selectively block SIGPIPE per-thread.

--
Manfred

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2004-12-01 08:02:41 Re: [HACKERS] Adding Reply-To: <listname> to Lists configuration ...
Previous Message Jan Wieck 2004-12-01 05:39:04 Re: [ANNOUNCE] USENET vs Mailing Lists Poll ...

Browse pgsql-patches by date

  From Date Subject
Next Message Gavin Sherry 2004-12-01 07:37:51 Re: Developer's FAQ update
Previous Message Bruce Momjian 2004-12-01 04:29:56 Re: libpq and psql not on same page about SIGPIPE