Re: Avoiding SIGPIPE (was Re: OSDL DBT-2 w/ PostgreSQL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Avoiding SIGPIPE (was Re: OSDL DBT-2 w/ PostgreSQL
Дата
Msg-id 5377.1067814405@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Avoiding SIGPIPE (was Re: OSDL DBT-2 w/ PostgreSQL  (Manfred Spraul <manfred@colorfullife.com>)
Ответы Re: Avoiding SIGPIPE (was Re: OSDL DBT-2 w/ PostgreSQL
Список pgsql-hackers
Manfred Spraul <manfred@colorfullife.com> writes:
> If I understand libpq sources correctly, the first packets are send 
> during connection setup - PQsigpipeOK(PGconn *) would be too late.
> That's why I added "sigpipe=caller" as a new flag for PQconnectdb.

That's definitely a problem, but "sigpipe=caller" is one of the very
worst aspects of your proposal.  In many apps the connectinfo string is
passed in more-or-less-directly from user input.  But having the user
fool with sigpipe handling would be disastrous --- either the app is
coded to handle sigpipe properly for itself, or it isn't.  If we're
going to make a hook that allows the app to tell libpq how to handle
sigpipe, then we have to make it feed in the information in some way
other than via the connectinfo string.

It strikes me that sigpipe handling will be a global affair in any
particular application --- it's unlikely that it would be correct for
some PG connections and wrong for others.  So one possibility is to make
the control variable be global (static) and thus it could be set before
creating the first PGconn.
        regards, tom lane


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: PlayStation 2 problems
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: Experimental patch for inter-page delay in VACUUM