Re: SIGPIPE handling

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: SIGPIPE handling
Дата
Msg-id 200311161800.hAGI0t710877@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: SIGPIPE handling  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: SIGPIPE handling  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Is running the rest of the
> > application with SIGPIPE <= SIG_IGN a problem?
>
> That is NOT an acceptable thing for a library to do.

Yes, I was afraid of that.  Here's another idea.  If the signal handler
is SIG_DFL, we install our own signal handler for SIGPIPE, and set/clear a
global variable before/after we send().  When our signal handler is
called, we check to see if our global variable is set, and we either
ignore or exit().  Can we do that safely?  Seems it only fails when they
register a signal handler after establishing a database connection.

How would this work in a threaded app --- not too well, I think.

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

В списке pgsql-patches по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SIGPIPE handling
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SIGPIPE handling