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

Commite5b7451

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 parent933b466 commite5b7451

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
@@ -484,7 +484,6 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid)
484484
volatilePROC_HDR*procglobal=ProcGlobal;
485485
uint32nextidx;
486486
uint32wakeidx;
487-
intextraWaits=-1;
488487

489488
/* We should definitely have an XID to clear. */
490489
Assert(TransactionIdIsValid(allPgXact[proc->pgprocno].xid));
@@ -511,6 +510,8 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid)
511510
*/
512511
if (nextidx!=INVALID_PGPROCNO)
513512
{
513+
intextraWaits=0;
514+
514515
/* Sleep until the leader clears our XID. */
515516
for (;;)
516517
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp