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 1tAMJ8-00FI0v-1S for pgsql-admin@arkaria.postgresql.org; Mon, 11 Nov 2024 04:45:45 +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 1tAMJ5-00BIcZ-Fn for pgsql-admin@arkaria.postgresql.org; Mon, 11 Nov 2024 04:45:44 +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.94.2) (envelope-from ) id 1tAMJ5-00BIcO-4g for pgsql-admin@lists.postgresql.org; Mon, 11 Nov 2024 04:45:43 +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.94.2) (envelope-from ) id 1tAMJ2-001Ios-5d for pgsql-admin@lists.postgresql.org; Mon, 11 Nov 2024 04:45:43 +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 4AB4jcJw216311; Sun, 10 Nov 2024 23:45:38 -0500 From: Tom Lane To: Edwin UY cc: "David G. Johnston" , "pgsql-admin@lists.postgresql.org" Subject: Re: How to check if session is a hung thread/session In-reply-to: References: Comments: In-reply-to Edwin UY message dated "Mon, 11 Nov 2024 17:08:55 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <216309.1731300338.1@sss.pgh.pa.us> Date: Sun, 10 Nov 2024 23:45:38 -0500 Message-ID: <216310.1731300338@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Edwin UY writes: > I thought it could be the backend has sent something back to the client but > it never received it and it just kept on doing the same at some intervals. Your pg_stat_activity output shows the backend is idle, meaning it's waiting for a client command. While the session has been around for days, we can see the last client command was about 47 minutes ago, from your "now() - pg_stat_activity.query_start AS duration" column. I see no reason to think there is anything interesting here at all, except for a client that is sitting doing nothing for long periods. regards, tom lane