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 1txp1r-00F9vT-3M for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Mar 2025 15:20:23 +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 1txp0r-008NOz-9p for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Mar 2025 15:19:21 +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 1txp0q-008NO0-7w for pgsql-hackers@lists.postgresql.org; Thu, 27 Mar 2025 15:19:21 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1txp0o-001S2h-0c for pgsql-hackers@postgresql.org; Thu, 27 Mar 2025 15:19:19 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 2043D1140152 for ; Thu, 27 Mar 2025 11:19:17 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Thu, 27 Mar 2025 11:19:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1743088757; x=1743175157; bh=pkFR/rup76I2U0pzxYoPkm66PFimrFBo /zDJpwq9+pM=; b=a2wIsqKUc0Xymv2q5GjflOuJMzeG91N9+Q03AP5OreIdKhHa CXGfxwEY8LvpKFyizB/mokh8TJFfxee6YkPh2dkdsKAWRKqSHoo78XyzqFMyn4a3 P2P0Rs3OBc/g1oKMJ+VhSLoEO1VUSXoF6jvhIysxZWqGmOe/JYkBRryY9Mj05MFb N2CQfEXf7GnZm6O8h+AN1ae+8SkFMcazV2gv6tXh37M+9GmId6S6MP9I4WHTSeV2 pf4b++szQYHRjSOUw81umVlPTbrVf3Z6dIwRAcrooHF4Cq85eDCSMw3+n/5jVZjI I8MZmWEbhxe9AxJiHfBHygBMlzLMebG5b/uWww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1743088757; x= 1743175157; bh=pkFR/rup76I2U0pzxYoPkm66PFimrFBo/zDJpwq9+pM=; b=H 79y9O4SkiliN3WgJnhiMMAwem8hoK+XAjBykt3dCi+OQ611JSujsDLTA5lzPwZ1P xVsybTg11fboIxwEvUxkyzy4ByQZnvPsrZ5KWeirAdLxe5C/3AqvaX9H/3qTYNhU cgB9F9Y155d805XoHD8Hkzu7S2F4V1V9jigurZ10e92cVFpYTBEdzdiTSxq9fFBU IvVIExGw5BKwrSvMo8Yrm/E/fxSo1uyqWhISkGHmLWiLoO+hNQ90uTphAn5LYQAO RMbVF6eEg9/ihdtgywZfEEHofUqxwB4M5fkKPVSrrESM+NjydiN57vop/PfHjYxs /XIOhImKZVNTy3GMQvgbQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieekjeeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhf fvuffkgggtugesthdtsfdttddtvdenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcu oegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrthhtvghrnhepgefftd fgjeefgfduueffffevhfeiuefggefgkeevfeetleeffefhtdegvefhtdeknecuffhomhgr ihhnpegtihhrrhhushdqtghirdgtohhmpdhpohhsthhgrhdrvghsnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgr iigvlhdruggvpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtph htthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 27 Mar 2025 11:19:16 -0400 (EDT) Date: Thu, 27 Mar 2025 11:19:16 -0400 From: Andres Freund To: pgsql-hackers@postgresql.org Subject: libpq maligning postgres stability Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, 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. The reason I was looking at this message just now was a discussion of CI failures on windows [1], which were likely caused by the known issue of windows occasionally swallowing the server's last messages before the backend exits (more detail e.g. in [2]). It's easy to think that the failure was wrongly caused by a postgres crash, due to the message, rather than due to not receiving the expected FATAL. And we don't even just add this message when the connection was actually closed unexpectedly, we often do it even when we *did* get a FATAL, as in this example: psql -c 'select pg_terminate_backend(pg_backend_pid())' FATAL: 57P01: terminating connection due to administrator command LOCATION: ProcessInterrupts, postgres.c:3351 server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. connection to server was lost I think this one is mostly a weakness in how libpq tracks connection state, but it kind of shows the silliness of claiming postgres probably crashed. Greetings, Andres Freund [1] Via Bilal: 4 of the failures on the front page are related to Windows: https://cirrus-ci.com/build/4878370632105984 https://cirrus-ci.com/build/5063665856020480 https://cirrus-ci.com/build/4636858312818688 https://cirrus-ci.com/build/6385762419081216 [2] https://postgr.es/m/CA%2BhUKGLR10ZqRCvdoRrkQusq75wF5%3DvEetRSs2_u1s%2BFAUosFQ%40mail.gmail.com