The following bug has been logged on the website:
Bug reference: 17140
Logged by: Yuri Cherio
Email address: cherio(at)gmail(dot)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.