After closing frontend socket, set MyProcPort->sock = -1 to ensure that
subsequent I/O attempts fail cleanly. I'm speculating about failure scenarios in which we do pq_close, then something in a proc_exit routine opens a file (re-using that kernel FD number), then something else fails and tries to write an elog message to the frontend ... message ends up in opened file, oops. No known examples of this but it seems like a potential hole.
Showing
Please register or sign in to comment