]> granicus.if.org Git - postgresql/commit
On Windows, retry process creation if we fail to reserve shared memory.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 10 Jul 2017 15:00:09 +0000 (11:00 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 10 Jul 2017 15:00:09 +0000 (11:00 -0400)
commit45e004fb4e3937dbdabf6d5c1706f1a02fdceb94
tree51a7d31eb533f6bab8fa794e9ac1f3272b20fc2d
parentd137a6dc239bd32b424826acbb25277ac611ddb1
On Windows, retry process creation if we fail to reserve shared memory.

We've heard occasional reports of backend launch failing because
pgwin32_ReserveSharedMemoryRegion() fails, indicating that something
has already used that address space in the child process.  It's not
very clear what, given that we disable ASLR in Windows builds, but
suspicion falls on antivirus products.  It'd be better if we didn't
have to disable ASLR, anyway.  So let's try to ameliorate the problem
by retrying the process launch after such a failure, up to 100 times.

Patch by me, based on previous work by Amit Kapila and others.
This is a longstanding issue, so back-patch to all supported branches.

Discussion: https://postgr.es/m/CAA4eK1+R6hSx6t_yvwtx+NRzneVp+MRqXAdGJZChcau8Uij-8g@mail.gmail.com
src/backend/postmaster/postmaster.c