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 1rGL2Z-00EnHl-1L for pgsql-general@arkaria.postgresql.org; Thu, 21 Dec 2023 15:32:51 +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 1rGL2W-00Ah3z-Ac for pgsql-general@arkaria.postgresql.org; Thu, 21 Dec 2023 15:32:48 +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 1rGL2V-00Ah3r-R8 for pgsql-general@lists.postgresql.org; Thu, 21 Dec 2023 15:32:47 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rGL2T-00BWKE-4k for pgsql-general@lists.postgresql.org; Thu, 21 Dec 2023 15:32:46 +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 3BLFWhiP657078; Thu, 21 Dec 2023 10:32:43 -0500 From: Tom Lane To: Andrey Zhidenkov cc: pgsql-general@lists.postgresql.org Subject: Re: PostgreSQL 15.5 stops processing user queries In-reply-to: References: Comments: In-reply-to Andrey Zhidenkov message dated "Thu, 21 Dec 2023 15:32:32 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <657076.1703172763.1@sss.pgh.pa.us> Date: Thu, 21 Dec 2023 10:32:43 -0500 Message-ID: <657077.1703172763@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrey Zhidenkov writes: > We have encountered an issue with our PostgreSQL 15.5 installation. The > problem is that > PostgreSQL server periodically falls into a state when it accepts new > connections but > doesn't execute any queries. The session which runs a query hangs and > cannot be terminated > via SIGINT (even if it's just "SELECT 1") - a corresponding linux process > has state "S" and it's > not terminated even if the PostgreSQL master process is stopped. No matter > how we connect to > the database - both TCP and unix socket sessions hang but it seems that > existing sessions can > still execute queries (once we succeeded to connect using pgBouncer which > seemed to use an > existing connection to the database). Try using an existing session to capture pg_stat_activity and pg_locks information about the stuck session(s). > Here is a stack trace from gdb for one of the frozen sessions: This appears to be a trace of a psql process waiting for a query result. It won't teach you much about what the server is doing. regards, tom lane