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