log-pid.patch
text/x-patch
Filename: log-pid.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/backend/storage/ipc/latch.c | 7 | 2 |
diff --git a/src/backend/storage/ipc/latch.c b/src/backend/storage/ipc/latch.c
index 78c6a89271..07b8273a7d 100644
--- a/src/backend/storage/ipc/latch.c
+++ b/src/backend/storage/ipc/latch.c
@@ -402,6 +402,8 @@ InitSharedLatch(Latch *latch)
void
OwnLatch(Latch *latch)
{
+ pid_t previous_owner;
+
/* Sanity checks */
Assert(latch->is_shared);
@@ -410,8 +412,11 @@ OwnLatch(Latch *latch)
Assert(selfpipe_readfd >= 0 && selfpipe_owner_pid == MyProcPid);
#endif
- if (latch->owner_pid != 0)
- elog(ERROR, "latch already owned");
+ previous_owner = latch->owner_pid;
+ if (previous_owner != 0)
+ elog(ERROR,
+ "latch already owned by PID %lu",
+ (unsigned long) previous_owner);
latch->owner_pid = MyProcPid;
}