Re: [PATCH] Fix socket handle inheritance on Windows

2025-11-06 Thread Thomas Munro
On Fri, Nov 7, 2025 at 2:35 PM Bryan Green wrote: > If you agree, and I think you do, I will implement the SOCK_CLOEXEC > abstraction and the socket_set_cloexec helper for this. My bug fix will > be the first user. +1 Thanks for working on all this stuff. > I also need to handle the handles fo

Re: [PATCH] Fix socket handle inheritance on Windows

2025-11-06 Thread Bryan Green
On 11/6/25 19:03, Thomas Munro wrote: On Fri, Nov 7, 2025 at 7:53 AM Bryan Green wrote: The socket fix adds WSA_FLAG_NO_HANDLE_INHERIT to WSASocket() in pgwin32_socket(), and calls SetHandleInformation() in BackendInitialize() to mark the inherited client socket non-inheritable. The latter is n

Re: [PATCH] Fix socket handle inheritance on Windows

2025-11-06 Thread Thomas Munro
On Fri, Nov 7, 2025 at 7:53 AM Bryan Green wrote: > > The socket fix adds WSA_FLAG_NO_HANDLE_INHERIT to WSASocket() in > > pgwin32_socket(), and calls SetHandleInformation() in > > BackendInitialize() to mark the inherited client socket non-inheritable. > > The latter is needed because handles pas

Re: [PATCH] Fix socket handle inheritance on Windows

2025-11-06 Thread Bryan Green
On 11/5/2025 11:06 PM, Bryan Green wrote: > Greetings, > > I've discovered that PostgreSQL on Windows has a handle inheritance > problem that prevents clean restarts after the postmaster is killed > while child processes are running. > > The issue is that Windows handles (files, sockets, pipes, s