Re: libpq and psql not on same page about SIGPIPE
От | Manfred Spraul |
---|---|
Тема | Re: libpq and psql not on same page about SIGPIPE |
Дата | |
Msg-id | 41AD6A3A.1040004@colorfullife.com обсуждение исходный текст |
Ответ на | Re: libpq and psql not on same page about SIGPIPE (Bruce Momjian <pgman@candle.pha.pa.us>) |
Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления: