diff options
author | Magnus Hagander <magnus@hagander.net> | 2010-09-16 20:37:13 +0000 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2010-09-16 20:37:13 +0000 |
commit | 594419e74ad495aa116e08e306416b3a090513c5 (patch) | |
tree | 1d46434d9ac7c11414baa1e94566a3be3029abb9 /src | |
parent | f7270a65b3085752813df3adc9e7b8f292c02a8e (diff) | |
download | postgresql-594419e74ad495aa116e08e306416b3a090513c5.tar.gz postgresql-594419e74ad495aa116e08e306416b3a090513c5.zip |
Treat exit code 128 (ERROR_WAIT_NO_CHILDREN) as non-fatal on Win32,
since it can happen when a process fails to start when the system
is under high load.
Per several bug reports and many peoples investigation.
Back-patch to 8.4, which is as far back as the "deadman-switch"
for shared memory access exists.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 7d48bb2545b..b0225a8c675 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.615 2010/07/20 00:47:52 rhaas Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.616 2010/09/16 20:37:13 mha Exp $ * * NOTES * @@ -2588,6 +2588,19 @@ CleanupBackend(int pid, * assume everything is all right and proceed to remove the backend from * the active backend list. */ +#ifdef WIN32 + /* + * On win32, also treat ERROR_WAIT_NO_CHILDREN (128) as nonfatal + * case, since that sometimes happens under load when the process fails + * to start properly (long before it starts using shared memory). + */ + if (exitstatus == ERROR_WAIT_NO_CHILDREN) + { + LogChildExit(LOG, _("server process"), pid, exitstatus); + exitstatus = 0; + } +#endif + if (!EXIT_STATUS_0(exitstatus) && !EXIT_STATUS_1(exitstatus)) { HandleChildCrash(pid, exitstatus, _("server process")); |