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

Commit6032991

Browse files
committed
Fix possible leak of semaphore count.
Commit4aec498 reorganized the orderof operations here so that we no longer increment the number of "extrawaits" before locking the semaphore, but it did not change thestarting value of extraWaits from 0 to -1 to compensate. In the worstcase, this could leak a semaphore count, but that seems to be unlikelyin practice.Discussion:http://postgr.es/m/CAA4eK1JyVqXiMba+-a589Rk0pyHsyKkGxeumVKjU6Y74hdrVLQ@mail.gmail.comAmit Kapila, per an off-list report by Dilip Kumar. Reviewed by me.
1 parent5b4f8f4 commit6032991

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/storage/ipc/procarray.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid)
491491
volatilePROC_HDR*procglobal=ProcGlobal;
492492
uint32nextidx;
493493
uint32wakeidx;
494-
intextraWaits=-1;
495494

496495
/* We should definitely have an XID to clear. */
497496
Assert(TransactionIdIsValid(allPgXact[proc->pgprocno].xid));
@@ -518,6 +517,8 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid)
518517
*/
519518
if (nextidx!=INVALID_PGPROCNO)
520519
{
520+
intextraWaits=0;
521+
521522
/* Sleep until the leader clears our XID. */
522523
for (;;)
523524
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp