Re: libpq and psql not on same page about SIGPIPE

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Manfred Spraul <manfred(at)colorfullife(dot)com>
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-02 14:58:28
Message-ID: 200412021458.iB2EwSL01312@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Manfred Spraul wrote:
> Tom Lane wrote:
>
> >Not really: it only solves the problem *if you change the application*,
> >which is IMHO not acceptable. In particular, why should a non-threaded
> >app expect to have to change to deal with this issue? But we can't
> >safely build a thread-safe libpq.so for general use if it breaks
> >non-threaded apps that haven't been changed.
> >
> >
> >
> No. non-threaded apps do not need to change. The default is the old, 7.3
> code: change the signal handler around the write calls. Which means that
> non-threaded apps are guaranteed to work without any changes, regardless
> of the libpq thread safety setting.
> Threaded apps would have to change, but how many threaded apps use
> libpq? They check their code anyway - either just add PQinitLib() or
> review (and potentialy update) their signal handling code if it match
> any of the gotchas of the transparent handling.

So without the call we do the old non-threaded version of the code.
Yea, we could do that, but I think the most recent patch is clearer.

--
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-12-02 14:59:19 Re: lwlocks and starvation
Previous Message simon 2004-12-02 10:46:02 Re: Re: lwlocks and starvation

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-12-02 15:49:03 Re: pt_BR FAQ updated
Previous Message Greg Stark 2004-12-02 07:21:24 Re: [PATCHES] plperl Safe restrictions