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

Commit12e28aa

Browse files
committed
Add debugging help in OwnLatch().
Build farm animal gharial recently failed a few times in a parallelworker's call to OwnLatch() with "ERROR: latch already owned". Let'sturn that into a PANIC and show the PID of the owner, to try to learnmore.Discussion:https://postgr.es/m/CA%2BhUKGJ_0RGcr7oUNzcHdn7zHqHSB_wLSd3JyS2YC_DYB%2B-V%3Dg%40mail.gmail.com
1 parent5f0adec commit12e28aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ InitSharedLatch(Latch *latch)
402402
void
403403
OwnLatch(Latch*latch)
404404
{
405+
intowner_pid;
406+
405407
/* Sanity checks */
406408
Assert(latch->is_shared);
407409

@@ -410,8 +412,9 @@ OwnLatch(Latch *latch)
410412
Assert(selfpipe_readfd >=0&&selfpipe_owner_pid==MyProcPid);
411413
#endif
412414

413-
if (latch->owner_pid!=0)
414-
elog(ERROR,"latch already owned");
415+
owner_pid=latch->owner_pid;
416+
if (owner_pid!=0)
417+
elog(PANIC,"latch already owned by PID %d",owner_pid);
415418

416419
latch->owner_pid=MyProcPid;
417420
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp