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

Commit9cce91d

Browse files
committed
Only log 'process acquired lock' if we actually did get the lock. This
test seems inessential right now since the only control path for notgetting the lock is via CHECK_FOR_INTERRUPTS which won't return controlto ProcSleep, but it would be important if we ever allow the deadlockcode to kill someone else's transaction instead of our own.
1 parentec4595d commit9cce91d

File tree

1 file changed

+5
-4
lines changed
  • src/backend/storage/lmgr

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.189 2007/06/1920:13:21 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.190 2007/06/1922:01:15 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -887,7 +887,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
887887
switch (deadlock_state)
888888
{
889889
caseDS_NOT_YET_CHECKED:
890-
/*Spurious wakeup as described above */
890+
/*Lock granted, or spurious wakeup as described above */
891891
break;
892892
caseDS_NO_DEADLOCK:
893893
caseDS_SOFT_DEADLOCK:
@@ -918,16 +918,17 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
918918
(errmsg("process %d still waiting for %s on %s after %ld.%03d ms",
919919
MyProcPid,modename,buf.data,
920920
msecs,usecs)));
921-
else
921+
elseif (MyProc->waitStatus==STATUS_OK)
922922
ereport(LOG,
923923
(errmsg("process %d acquired %s on %s after %ld.%03d ms",
924924
MyProcPid,modename,buf.data,
925925
msecs,usecs)));
926+
/* ERROR will be reported later, so no message here */
926927
pfree(buf.data);
927928
break;
928929
}
929930
caseDS_HARD_DEADLOCK:
930-
/* ERROR will be reportedbelow, so no message here */
931+
/* ERROR will be reportedlater, so no message here */
931932
break;
932933
}
933934
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp