Re: [HACKERS] exit() behavior on Windows?

2016-05-14 Thread Tom Lane
I wrote:
> If it's just a quick kill, then there's a totally separate bug here for
> Windows.  What is likely to happen with the current coding is that a
> failing child thread will queue its error message into the communication
> pipe, and then exit(1), thereby killing the whole pg_dump process before
> the master thread can receive and print the error.

Ah, scratch that --- I hadn't noticed the badly-underdocumented #ifdef
in exit_nicely().

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] exit() behavior on Windows?

2016-05-14 Thread Tom Lane
Rather belatedly, I've started to look into a fix for pg_dump's
problem with error reporting in parallel mode:
http://www.postgresql.org/message-id/2458.1450894...@sss.pgh.pa.us

One of the issues here is that pg_dump uses threads not subprocesses
to do parallelism on Windows, which means that totally different
reasoning is needed for that case.  I'm looking in particular at the
use of exit().  What I gather from Microsoft's documentation is that
exit() will kill the whole process not just the calling thread ---
can anyone confirm that that's correct?  Are the other threads just
killed asynchronously, or do they get a chance to shut down?

If it's just a quick kill, then there's a totally separate bug here for
Windows.  What is likely to happen with the current coding is that a
failing child thread will queue its error message into the communication
pipe, and then exit(1), thereby killing the whole pg_dump process before
the master thread can receive and print the error.  The visible result
would be about the same as what I described on Linux, ie failure exit
with no error message reported.  But the mechanism is different.

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers