pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #17140: pg_try_advisory_xact_lock produces a WARNINIG on unsuccessful lock
3+ messages / 3 participants
[nested] [flat]
* BUG #17140: pg_try_advisory_xact_lock produces a WARNINIG on unsuccessful lock
@ 2021-08-10 18:29 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: PG Bug reporting form @ 2021-08-10 18:29 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: cherio@gmail.com
The following bug has been logged on the website:
Bug reference: 17140
Logged by: Yuri Cherio
Email address: cherio@gmail.com
PostgreSQL version: 13.3
Operating system: Ubuntu Linux 20.04
Description:
Function "pg_try_advisory_xact_lock" triggers a WARNING message when the
lock is already owned by someone else. The documentation explicitly mentions
warnings on advisory unlock functions and those are understandable - the
developer should not try to unlock what's not owned.
However the advisory lock functions are there for this specific reason -
test whether a resource is locked or not. A negative test should not produce
a WARNING.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #17140: pg_try_advisory_xact_lock produces a WARNINIG on unsuccessful lock
@ 2021-08-11 13:50 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2021-08-11 13:50 UTC (permalink / raw)
To: cherio@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> writes:
> Function "pg_try_advisory_xact_lock" triggers a WARNING message when the
> lock is already owned by someone else.
I failed to duplicate this behavior. I did this in session A:
regression=# begin;
BEGIN
regression=*# select pg_try_advisory_xact_lock(1);
pg_try_advisory_xact_lock
---------------------------
t
(1 row)
then this in session B:
regression=# select pg_try_advisory_xact_lock(1);
pg_try_advisory_xact_lock
---------------------------
f
(1 row)
No warning...
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #17140: pg_try_advisory_xact_lock produces a WARNINIG on unsuccessful lock
@ 2021-08-11 15:39 Cherio <cherio@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Cherio @ 2021-08-11 15:39 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org
I can not reproduce it any more.
There is a chance there were more forces at play when I was getting the
lock warning message.
Please forgive the disturbance.
On Wed, Aug 11, 2021 at 9:50 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> PG Bug reporting form <noreply@postgresql.org> writes:
> > Function "pg_try_advisory_xact_lock" triggers a WARNING message when the
> > lock is already owned by someone else.
>
> I failed to duplicate this behavior. I did this in session A:
>
> regression=# begin;
> BEGIN
> regression=*# select pg_try_advisory_xact_lock(1);
> pg_try_advisory_xact_lock
> ---------------------------
> t
> (1 row)
>
> then this in session B:
>
> regression=# select pg_try_advisory_xact_lock(1);
> pg_try_advisory_xact_lock
> ---------------------------
> f
> (1 row)
>
> No warning...
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-08-11 15:39 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 18:29 BUG #17140: pg_try_advisory_xact_lock produces a WARNINIG on unsuccessful lock PG Bug reporting form <noreply@postgresql.org>
2021-08-11 13:50 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-08-11 15:39 ` Cherio <cherio@gmail.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