pg_dump: check for _beginthreadex() failure in parallel dump

ParallelBackupStart() stored _beginthreadex()'s return value as the
worker's thread handle without checking it.  On failure that value is 0,
which would later reach WaitForMultipleObjects() as a null handle, caught
only by an Assert.  The fork() path already calls pg_fatal() when it
fails; do the same for _beginthreadex(), as pgbench does.

Author: Bryan Green <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/[email protected]
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0e93895f02c0d696d78eea610435d4fa8e3293e0

Modified Files
--------------
src/bin/pg_dump/parallel.c | 2 ++
1 file changed, 2 insertions(+)

Reply via email to