Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1la4yg-0005pN-0v for pgsql-general@arkaria.postgresql.org; Fri, 23 Apr 2021 23:12:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1la4ye-0002Ch-5B for pgsql-general@arkaria.postgresql.org; Fri, 23 Apr 2021 23:12:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1la4yd-0002Ca-U9 for pgsql-general@lists.postgresql.org; Fri, 23 Apr 2021 23:12:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1la4yb-0002GY-MW for pgsql-general@lists.postgresql.org; Fri, 23 Apr 2021 23:12:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13NNCfc31624114; Fri, 23 Apr 2021 19:12:42 -0400 From: Tom Lane To: Eric Hill cc: "pgsql-general@lists.postgresql.org" Subject: Re: server process exited with code 1 In-reply-to: References: ,<1385517.1619195801@sss.pgh.pa.us> Comments: In-reply-to Eric Hill message dated "Fri, 23 Apr 2021 19:30:12 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1624112.1619219561.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Apr 2021 19:12:41 -0400 Message-ID: <1624113.1619219561@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Eric Hill writes: > I don=C2=92t believe we have any unusual extensions. We do have trigger= s, and the VM does have antivirus protection. I=C2=92ll work on exclusion= s for the AV, and we=C2=92ll look into our triggers a bit. BTW, I happened to check in our commit log to see when we installed the dead man switch I referred to, and the commit message is quite interesting: Author: Tom Lane Branch: master Release: REL8_4_BR [969d7cd43] 2009-05-05 19:59:00 +0000 Install a "dead man switch" to allow the postmaster to detect cases wh= ere a backend has done exit(0) or exit(1) without having disengaged itself from shared memory. We are at risk for this whenever third-party code= is loaded into a backend, since such code might not know it's supposed to= go through proc_exit() instead. Also, it is reported that under Windows there are ways to externally kill a process that cause the status code returned to the postmaster to be indistinguishable from a voluntary ex= it (thank you, Microsoft). If this does happen then the system is probab= ly hosed --- for instance, the dead session might still be holding locks. So the best recovery method is to treat this like a backend crash. = The dead man switch is armed for a particular child process when it acquires a regular PGPROC, and disarmed when the PGPROC is released; these should be the first and last touches of shared memory resources in a backend, or close enough anyway. This choice means there is no coverage for auxiliary processes, but I doubt we need that, since they shouldn't be executing any user-provided code anyway. So it seems like you'd better be looking into the possibility that something entirely external to Postgres is causing that backend process to quit with what looks like _exit(1). Unfortunately, this commit is from before we had a habit of including links to mailing list discussions in commit messages; but if you dig around in the pghackers archives near that date you can probably find the thread, and maybe there will be more info about the Windows aspect. (I'm not a Windows guy, so this was purely hearsay on my part.) regards, tom lane