pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #16194: use postgresql's  pg_advisory_xact_lock error
2+ messages / 2 participants
[nested] [flat]

* BUG #16194: use postgresql's  pg_advisory_xact_lock error
@ 2020-01-07 09:33  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2020-01-07 09:33 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: andy.ye@gtssz.net

The following bug has been logged on the website:

Bug reference:      16194
Logged by:          andy ye
Email address:      andy.ye@gtssz.net
PostgreSQL version: 9.5.11
Operating system:   ubuntu 16.04
Description:        

When I use postgresql's pg_advisory_xact_lock for transaction security,
especially RPC services, I often see that the lock is not released, causing
the service to block for a long time. The blocking time is about 15 minutes.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #16194: use postgresql's  pg_advisory_xact_lock error
@ 2020-01-07 09:49  Tomas Vondra <tomas.vondra@2ndquadrant.com>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tomas Vondra @ 2020-01-07 09:49 UTC (permalink / raw)
  To: andy.ye@gtssz.net; pgsql-bugs@lists.postgresql.org

On Tue, Jan 07, 2020 at 09:33:26AM +0000, PG Bug reporting form wrote:
>The following bug has been logged on the website:
>
>Bug reference:      16194
>Logged by:          andy ye
>Email address:      andy.ye@gtssz.net
>PostgreSQL version: 9.5.11
>Operating system:   ubuntu 16.04
>Description:
>
>When I use postgresql's pg_advisory_xact_lock for transaction security,
>especially RPC services, I often see that the lock is not released, causing
>the service to block for a long time. The blocking time is about 15 minutes.
>

That's rather suspicious. My guess would be that you're not actually
terminating the transaction, it's staying open and so the advisory lock
is not being released. And then ~15 minutes later some sort of timeout
is being hit, closing the connection (e.g. in a connection pool, app
server or something like that) and releasing the lock.

We need to see some sort of debugging info, demonstrating that the
transaction was actually finished (committed/released) and the lock is
still being held. So if you observe this, you need to get the relevant
info from pg_locks and pg_stat_activity.

A reproducer would be very useful, of course.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services 





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-01-07 09:49 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 09:33 BUG #16194: use postgresql's  pg_advisory_xact_lock error PG Bug reporting form <noreply@postgresql.org>
2020-01-07 09:49 ` Tomas Vondra <tomas.vondra@2ndquadrant.com>

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