Re: Sometimes the output to the stdout in Windows disappears
| От | Andrew Dunstan |
|---|---|
| Тема | Re: Sometimes the output to the stdout in Windows disappears |
| Дата | |
| Msg-id | bc946352-a7e8-bf81-9069-8bc9c912f674@dunslane.net обсуждение исходный текст |
| Ответ на | Re: Sometimes the output to the stdout in Windows disappears (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
On 10/16/20 12:18 PM, Tom Lane wrote: > > But wait a minute: I just looked at Microsoft's docs [1] and found > > In a multithreaded environment, WSACleanup terminates Windows Sockets > operations for all threads. > > This makes me (a) wonder if that explains the side-effects on stdio, > and (b) question why libpq is calling WSACleanup at all. > What if we arranged to call WSAStartup just once, during the first > libpq connection-open in a process, and then never did WSACleanup? > Surely the OS can cope with that, and it eliminates any risk that > WSACleanup breaks something. > > regards, tom lane > > [1] https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsacleanup > > This could explain random transient stdout/stderr failures we have seen over the years. I think we should at least give your suggestion a try - this is a good time in the dev cycle for such experiments. cheers andrew
В списке pgsql-hackers по дате отправления: