Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit360abc0

Browse files
committed
Be sure to release proc->backendLock after SetupLockInTable() failure.
The various places that transferred fast-path locks to the main lock tableneglected to release the PGPROC's backendLock if SetupLockInTable faileddue to being out of shared memory. In most cases this is no big deal sinceensuing error cleanup would release all held LWLocks anyway. But there aresome hot-standby functions that don't consider failure ofFastPathTransferRelationLocks to be a hard error, and in those cases thisoversight could lead to system lockup. For consistency, make all of theseplaces look the same as FastPathTransferRelationLocks.Noted while looking for the cause of Dan Wood's bugs --- this wasn't it,but it's a bug anyway.
1 parentc357be2 commit360abc0

File tree

1 file changed

+3
-0
lines changed
  • src/backend/storage/lmgr

1 file changed

+3
-0
lines changed

‎src/backend/storage/lmgr/lock.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,6 +2537,7 @@ FastPathTransferRelationLocks(LockMethod lockMethodTable, const LOCKTAG *locktag
25372537
if (!proclock)
25382538
{
25392539
LWLockRelease(partitionLock);
2540+
LWLockRelease(proc->backendLock);
25402541
return false;
25412542
}
25422543
GrantLock(proclock->tag.myLock,proclock,lockmode);
@@ -2592,6 +2593,7 @@ FastPathGetRelationLockEntry(LOCALLOCK *locallock)
25922593
if (!proclock)
25932594
{
25942595
LWLockRelease(partitionLock);
2596+
LWLockRelease(MyProc->backendLock);
25952597
ereport(ERROR,
25962598
(errcode(ERRCODE_OUT_OF_MEMORY),
25972599
errmsg("out of shared memory"),
@@ -4055,6 +4057,7 @@ VirtualXactLock(VirtualTransactionId vxid, bool wait)
40554057
if (!proclock)
40564058
{
40574059
LWLockRelease(partitionLock);
4060+
LWLockRelease(proc->backendLock);
40584061
ereport(ERROR,
40594062
(errcode(ERRCODE_OUT_OF_MEMORY),
40604063
errmsg("out of shared memory"),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp