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.96) (envelope-from ) id 1vo9IU-00FwXp-10 for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Feb 2026 00:02:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vo9IS-001Nmb-0S for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Feb 2026 00:02:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vo9IR-001NmT-2j for pgsql-hackers@lists.postgresql.org; Fri, 06 Feb 2026 00:02:03 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vo9IP-00000001GuP-24sv for pgsql-hackers@lists.postgresql.org; Fri, 06 Feb 2026 00:02:03 +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 61601q8X1667819; Thu, 5 Feb 2026 19:01:52 -0500 From: Tom Lane To: Fujii Masao cc: Jeremy Schneider , Jacob Champion , "pgsql-hackers@lists.postgresql.org" , Marat Buharov , Greg Sabino Mullane , Thomas Munro Subject: Re: client_connection_check_interval default value In-reply-to: References: <20260204213032.15bab46b@ardentperf.com> <20260205150452.00006167@ardentperf.com> Comments: In-reply-to Fujii Masao message dated "Fri, 06 Feb 2026 08:42:42 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1667817.1770336112.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 05 Feb 2026 19:01:52 -0500 Message-ID: <1667818.1770336112@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Fujii Masao writes: > On Fri, Feb 6, 2026 at 8:05 AM Jeremy Schneider > wrote: >> I did see a real system outage that could have been prevented by an >> appropriate default value here, since I didn't yet know to change it. > I'm not sure that client_connection_check_interval needs to be enabled > by default. I think enabling it by default is a nonstarter, because it changes behavior in a significant way. Specifically, it's always been the case that if the client disconnects during a non-SELECT query (or anything that doesn't produce output), the backend would complete that query before ending the session. I think it's very likely that there are users depending on that behavior. Jeremy is describing an application that evidently was built on the assumption that disconnecting early would abort a wait, but that assumption was not based on any testing. I think it's good that we now have an option to make such an assumption hold, but that does not translate to "we should force that behavior on everybody". Whether or not the overhead is insignificant, there's a good chance that the change would make more people unhappy than happy. > The issue is that backends blocked in ProcSleep() are woken up every > client_connection_check_interval and may emit a "still waiting" message > each time if log_lock_waits is enabled. To mitigate this, just one idea is > to add a flag to track whether the "still waiting" message has already been > emitted during a call to ProcSleep(), and suppress further messages > once it has been logged. Independently of what's the default, it seems like it'd be valuable to make that interaction better. I think it is reasonable to keep on emitting "still waiting" every so often, but we could probably rate-limit that to a lot less than every 2 seconds. regards, tom lane