aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2010-09-16 20:37:16 +0000
committerMagnus Hagander <magnus@hagander.net>2010-09-16 20:37:16 +0000
commit0af6a873c5c8c33d10e8d7799b056d9dc49f9a3b (patch)
tree62685c3de8c16c631d81de3d5b87a8a4c597c45b
parente0664d5cdcd555a163268b532d68304083cd737a (diff)
downloadpostgresql-0af6a873c5c8c33d10e8d7799b056d9dc49f9a3b.tar.gz
postgresql-0af6a873c5c8c33d10e8d7799b056d9dc49f9a3b.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.
-rw-r--r--src/backend/postmaster/postmaster.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 30635006060..435f03b8091 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.583.2.7 2009/12/02 17:41:07 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.583.2.8 2010/09/16 20:37:16 mha Exp $
*
* NOTES
*
@@ -2495,6 +2495,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"));