]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pg_dump: check for _beginthreadex() failure in parallel dump
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 7 Jul 2026 15:11:28 +0000 (18:11 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 7 Jul 2026 15:11:39 +0000 (18:11 +0300)
commit50313f8f015efd8d4f2de89e4d7fa83a8205aa6d
tree8d83eff5c4e0f70451a3c4fb2f4061c4d0ae5546
parentcf184ec77a04bf164692a0c7bcd148f1e96b71f2
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 <dbryan.green@gmail.com>
Discussion: https://www.postgresql.org/message-id/8c712d76-ecf7-4749-a6d8-dddc01f298ec@gmail.com
Backpatch-through: 14
src/bin/pg_dump/parallel.c