Treat exit code 128 (ERROR_WAIT_NO_CHILDREN) as non-fatal on Win32,
authorMagnus Hagander <[email protected]>
Thu, 16 Sep 2010 20:37:18 +0000 (20:37 +0000)
committerMagnus Hagander <[email protected]>
Wed, 29 Sep 2010 14:06:24 +0000 (16:06 +0200)
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.2, since testing shows no issues even though the
"deadman-switch" does not exist  in this version.

src/backend/postmaster/postmaster.c

index 5e705a36b4f3f1ad2e03584b0eae8bd1ef8f9c21..bd0aeaf3aa7d4d856ec2b785a081f48b7df0be45 100644 (file)
@@ -2338,6 +2338,19 @@ CleanupBackend(int pid,
     * assume everything is all right and simply 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"));