pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: andy ye <andy.ye@gtssz.net>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: About postgresql pg_advisory_xact_lock use!!!!
Date: Tue, 07 Jan 2020 07:41:40 -0500
Message-ID: <4820.1578400900@sss.pgh.pa.us> (raw)
In-Reply-To: <7F90A703-8E89-4D22-AA2B-41B643D4E1F9@gtssz.net>
References: <7F90A703-8E89-4D22-AA2B-41B643D4E1F9@gtssz.net>

andy ye <andy.ye@gtssz.net> writes:
> 	When I use the pg_advisory_xact_lock provided by postgresql, I often see that the lock part cannot be released and the service is blocked. I would like to know what situations might cause this behavior. Thank you!!!

I'd say the odds are just about 100% that you're not closing the
transaction.  Transaction-scope advisory locks are managed exactly
like any ordinary lock in the system, so if we had a bug that allowed
them to not be released at transaction end, there would be obvious
consequences everywhere.

			regards, tom lane





view thread (2+ messages)

Message-ID: <4820.1578400900@sss.pgh.pa.us>
Permalink:  ../4820.1578400900@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4820.1578400900@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andy.ye@gtssz.net
  Subject: Re: About postgresql pg_advisory_xact_lock use!!!!
  In-Reply-To: <4820.1578400900@sss.pgh.pa.us>
  References: <7F90A703-8E89-4D22-AA2B-41B643D4E1F9@gtssz.net> <4820.1578400900@sss.pgh.pa.us>

* 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