Re: Sometimes the output to the stdout in Windows disappears
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Victor Spirin <v.spirin@postgrespro.ru>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2020-08-31T18:31:24Z
Lists: pgsql-hackers
Victor Spirin <v.spirin@postgrespro.ru> writes: > Sometimes the output to stdout on Windows on multicore machines does not > go through after connecting and disconnecting to the server using the > PQconnectdbParams and PQfinish functions. I tested on 6 cores. Hm, why is this not Microsoft's bug to solve? I do wonder if this report is related to the intermittent ecpg failures we see on Windows machines, such as [1]. The details vary, but it's always a case of a .stdout file ending up empty when it should not be. I'd supposed though that it must be something specific to ecpg, since we never see anything like that anywhere but the ecpg tests. Even if you posit that libpq is doing something that somehow compromises stdio, that should affect psql-based tests too. > I am attaching a patch and a script for testing. > [ forced fflush in every snprintf call ] My goodness, that's a large hammer you're swinging. What effects has this kluge got on performance? While I think you may be on to something, this seems like a truly horrid way to "fix" it. We need to dig down further and understand what is actually happening. regards, tom lane [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=dory&dt=2020-08-13%2022%3A15%3A05
Commits
-
In libpq for Windows, call WSAStartup once and WSACleanup not at all.
- cdc7ace161d3 9.6.20 landed
- 883226441d67 11.10 landed
- 6acc31a201d8 9.5.24 landed
- 6670e91078b3 10.15 landed
- d2074daebe16 13.1 landed
- 407580aabb83 12.5 landed
- 7d00a6b2de8a 14.0 landed
-
Update the Winsock API version requested by libpq.
- d5a9a661fcd2 14.0 landed