Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rBR56-00AqlI-EW for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Dec 2023 02:59:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rBR51-003cx8-G2 for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Dec 2023 02:59:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rBR51-003cx0-6U for pgsql-hackers@lists.postgresql.org; Fri, 08 Dec 2023 02:59:07 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rBR4x-009LPJ-6O for pgsql-hackers@postgresql.org; Fri, 08 Dec 2023 02:59:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=Eiaqksvaj/RyqKh3VFWqhax9LJ8tq7GNsehOs4hDnQw=; b=ZEYT0 6BXBGxNbtC13RtlWIQY0k6HPIrecKZiKgbVSDjqEz1gFnQLbd/qbLiJyfmtWreJ/XR2cWBTs1p5Bd Dgva8qhKK/DoKNZZ3ofFHEmEEP9N/5hrpMvg4b8R8pFslIcaELVziyJLRW2QtSnJ5AMLOK+PC55si 4OnDEIiZ6XURNufeJrhpUpVY4YMlpO9DKKmmD6YBweR7x5st1bwRrNTzRhrmjd9sR/ZYYIM23Orbt BMxFXzJDnWlGS6CI9e21rPgEtrYbK4uPF9YflU+ijJksVd0TnptLv0KmfSaqA41fxxZvIKYj4lx2u WqOHMW7D4qpqAH94WSIcqMtUpdaHA==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1rBR4v-00BZnz-0n; Thu, 07 Dec 2023 21:59:01 -0500 Date: Thu, 7 Dec 2023 21:59:01 -0500 From: Bruce Momjian To: Laurenz Albe Cc: Tom Lane , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [HACKERS] psql casts aspersions on server reliability Message-ID: References: <15946.1475068481@sss.pgh.pa.us> <2543635.1700699932@sss.pgh.pa.us> <1e9012b85ffaf04efb13859465804ce9b08ce073.camel@cybertec.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Nov 24, 2023 at 10:19:29AM -0500, Bruce Momjian wrote: > On Fri, Nov 24, 2023 at 04:06:22AM +0100, Laurenz Albe wrote: > > On Thu, 2023-11-23 at 11:12 -0500, Bruce Momjian wrote: > > > On Wed, Nov 22, 2023 at 10:25:14PM -0500, Bruce Momjian wrote: > > > > Yes, you are correct. Here is a patch that implements the FATAL test, > > > > though I am not sure I have the logic correct or backwards, and I don't > > > > know how to test this. Thanks. > > > > > > I developed the attached patch which seems to work better. In testing > > > kill -3 on a backend or calling elog(FATAL) in the server for a > > > session, libpq's 'res' is NULL, meaning we don't have any status to > > > check for PGRES_FATAL_ERROR. It is very possible that libpq just isn't > > > structured to have the PGRES_FATAL_ERROR at the point where we issue this > > > message, and this is not worth improving. > > > > > > test=> select pg_sleep(100); > > > --> FATAL: FATAL called > > > > > > server closed the connection unexpectedly > > > --> This probably means the server terminated null > > > before or while processing the request. > > > The connection to the server was lost. Attempting reset: Succeeded. > > > > I don't thing "terminated null" is a meaningful message. > > Yes, this is just a debug build so we can see the values of 'res'. > Sorry for the confusion. This attached patch has the elog() added so > you can reproduce what I saw. > > I am actually unclear which exits should be labeled as "abnormal". There are five call sites which issue this message, so I looked at adding "abnormally" just at the call sites where it made sense, but I couldn't find a pattern. I don't plan to pursue this further. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you.