From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: ma100@hotmail.com
Subject: BUG #17591: elog(ERROR) cause SharedSnapshotLock deadlock
Date: Mon, 22 Aug 2022 06:23:59 +0000
Message-ID: <17591-6ae23a6598b64c4e@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17591
Logged by: ma liangzhu
Email address: ma100@hotmail.com
PostgreSQL version: 14.5
Operating system: centos7
Description:
in lock.c, we can see code Release lock before return , e.g.
```c
996: LockAcquireExtended
{
LWLockAcquire(partitionLock, LW_EXCLUSIVE);
proclock = SetupLockInTable( );
if (!proclock)
{
LWLockRelease(partitionLock); --- Release lock before return
ereport(ERROR,)
}
}
```
bug we can see some code doesn't release the lock. Does it may cause
deadlock?
```c
LockRelease()
{
LWLockAcquire(partitionLock, LW_EXCLUSIVE);
lock = locallock->lock;
if (!lock)
{
lock = (LOCK *) hash_search_with_hash_value( );
if (!lock)
2126: elog(ERROR, "failed to re-find shared lock object"); -- exit
without release
}
```
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, ma100@hotmail.com
Subject: Re: BUG #17591: elog(ERROR) cause SharedSnapshotLock deadlock
In-Reply-To: <17591-6ae23a6598b64c4e@postgresql.org>
* 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