Re: About postgresql pg_advisory_xact_lock use!!!!

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: andy ye <andy(dot)ye(at)gtssz(dot)net>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: About postgresql pg_advisory_xact_lock use!!!!
Date: 2020-01-07 12:41:40
Message-ID: 4820.1578400900@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

andy ye <andy(dot)ye(at)gtssz(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Jobin Augustine 2020-01-07 13:17:06 libpq parameter parsing problem
Previous Message Tomas Vondra 2020-01-07 09:49:37 Re: BUG #16194: use postgresql's pg_advisory_xact_lock error