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 1u1v6J-00AFlH-F4 for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Apr 2025 22:37:55 +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 1u1v6H-004QSL-V8 for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Apr 2025 22:37:54 +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 1u1v6H-004QS6-KL for pgsql-hackers@lists.postgresql.org; Mon, 07 Apr 2025 22:37:53 +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.96) (envelope-from ) id 1u1v6G-003YSQ-04 for pgsql-hackers@postgresql.org; Mon, 07 Apr 2025 22:37:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2025010100; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description; bh=+LWGepumOo4JyImN3VyD3BKwJcyYeM6KXcPf9eTaJ3I=; b=ep1BUJFX9/bMIUTWBWbWX3dcJU oxKNd7DGXexYfrWyA95y09mVvwi697ze9bxyEJbjg6HiVo7uxM/fb9Fj3579GwgRrY9FMuPjBbbR8 wiAmenLvoYYfgJ95sJJ+BJIrdNNHf46ygfR8O3U2wcffrzHZYvYhpmy2Yv2coFj5W3CiULNss97hR RrCKWS+E+Bx3ww+WiDoBiqDg+3S0HSwcGOsPbVcrnUOu7qkDIBue/HRnk4GV0WCqO3t9r1HA0Nzg5 nOZdDUE6YDTAFdlN0Hl7hGFoshLBnOqG1aD3FRZ2DBRIeSG+qniPkycQyeMxrISkvqWZh8hyC6Lhs CZU36uZA==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1u1v6D-009q2P-1y; Mon, 07 Apr 2025 18:37:49 -0400 Date: Mon, 7 Apr 2025 18:37:49 -0400 From: Bruce Momjian To: Robert Haas Cc: Andres Freund , pgsql-hackers@postgresql.org Subject: Re: libpq maligning postgres stability Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 27, 2025 at 11:48:26AM -0400, Robert Haas wrote: > On Thu, Mar 27, 2025 at 11:19 AM Andres Freund wrote: > > We have several places in libpq where libpq says that a connection closing is > > probably due to a server crash with a message like: > > > > server closed the connection unexpectedly > > This probably means the server terminated abnormally > > before or while processing > > > > I think this is rather unhelpful, at least these days. There are a lot of > > reasons the connection could have failed, the server having terminated > > abnormally is just one of them. > > > > It's common to see this due to network issues, for example. I've quite a few > > times fielded worried questions of postgres users due to the message. > > Yeah, I agree. I used to think this hint was helpful, but it's gotten > less helpful as the years have passed, because the server is more > stable these days. Another thing that can cause this (as discussed in > Discord) is that the individual backend process can have died, but not > the server as a whole. In that case, the hint is only accurate if you > mean "server" to read your individual server process. > > I wonder if, in addition to removing the hint, we could also consider > rewording the message. For example, a slight rewording to "server > connection closed unexpectedly" would avoid implying that it was the > server that took action, which is correct, because it could be a > firewall in between the machines or even security software on the > client side. Maybe there is some more dramatic rewording that is even > better, but there's probably some value in keeping it similar to what > people are used to seeing. FYI, I researched these messages in 2023 to see if the message can be adjusted based on the code line generating the message, but with no conclusion: https://www.postgresql.org/message-id/flat/CA%2BTgmoZYvqmyQpzSUdtDmtk4Aj94MppDGe9qVJczbPLy4G2Yfg%40mail.gmail.com -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.