pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: Jacque Edmund <jacqueedmund@gmail.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Old query lying around in pg_stat_activity for weeks
Date: Fri, 26 Mar 2021 19:25:28 +0800
Message-ID: <20210326112528.6uiso3o2fgk73rqg@nol> (raw)
In-Reply-To: <CANOmo00m4BDU1EqXQ6HAc8N7uQoiwo1zM=2BnR3Mq+K3hkGCHw@mail.gmail.com>
References: <CANOmo00m4BDU1EqXQ6HAc8N7uQoiwo1zM=2BnR3Mq+K3hkGCHw@mail.gmail.com>

On Fri, Mar 26, 2021 at 07:16:42AM -0400, Jacque Edmund wrote:
> Was alerted to an old query lying around in the pg_stat_activity view  on a
> little used server recently.   It ha no values for wait_event_type or
> wait_event and had an idle state value.  The query_start value was about
> two weeks old.  Odd, but after verifying it had no pg_lock lookup, I
> canceled it.
> 
> Might there be an infrequent staleness of items that appear in the
> pg_stat_activity view that is just understood to be there from time to time?

If the state is "idle" it means it's only a connection doing nothing, it's not
really consuming any resources.  You also can't cancel it, since it isn't doing
anything, just close it.

The best thing to do if you don't have persistent connections or a connection
pooler is to check where the connection coming from and investigate what could
be the client/application responsible for leaking an idle connection.





view thread (3+ messages)  latest in thread

Message-ID: <20210326112528.6uiso3o2fgk73rqg@nol>
Permalink:  ../20210326112528.6uiso3o2fgk73rqg@nol/
Also on:    postgresql.org/message-id/20210326112528.6uiso3o2fgk73rqg@nol

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: rjuju123@gmail.com, jacqueedmund@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Old query lying around in pg_stat_activity for weeks
  In-Reply-To: <20210326112528.6uiso3o2fgk73rqg@nol>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox