Tom Lane wrote:
>My quibble with David has been about whether the fix is correct in
>detail, not about whether its purpose is correct.
>
My preference is to spin until ! EINTR as soon as possible after the
socket operation. I'm going to seek some advice from kernel people
regarding the inner workings of sockets. I suspect that we'll be able
to get away with handling it like as is done with EINPROGRESS, but
something is nagging me at the back of my head.
In regards to the other signals, I think there is another subtle
problem. Remember a month ago when I had a huge database that I had to
upgrade, I had no disk space to export it to and when the old version of
psql ran out of memory it crashed? The backend continued to push query
data out the closed pipe until the backend was forcibly closed or the
query completed. Naturally this caused considerable spammage on the
console.
So I suspect some tuning needs to be done in respect to SIGPIPE w/ the
backend.
David