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

Commit7bc84a1

Browse files
committed
Fix kqueue support under debugger on macOS.
While running under a debugger, macOS's getppid() can return thedebugger's PID. That could cause a backend to exit because it falselybelieved that the postmaster had died, since commit815c2f0.Continue to use getppid() as a fast postmaster check after adding thepostmaster's PID to a kqueue, to close a PID-reuse race, but doublecheck that it actually exited by trying to read the pipe. The new checkisn't reached in the common case.Reported-by: Alexander Korotkov <a.korotkov@postgrespro.ru>Discussion:https://postgr.es/m/CA%2BhUKGKhAxJ8V8RVwCo6zJaeVrdOG1kFBHGZOOjf6DzW_omeMA%40mail.gmail.com
1 parente6c178b commit7bc84a1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,8 +1094,17 @@ WaitEventAdjustKqueue(WaitEventSet *set, WaitEvent *event, int old_events)
10941094
errmsg("%s failed: %m",
10951095
"kevent()")));
10961096
}
1097-
elseif (event->events==WL_POSTMASTER_DEATH&&PostmasterPid!=getppid())
1097+
elseif (event->events==WL_POSTMASTER_DEATH&&
1098+
PostmasterPid!=getppid()&&
1099+
!PostmasterIsAlive())
1100+
{
1101+
/*
1102+
* The extra PostmasterIsAliveInternal() check prevents false alarms on
1103+
* systems that give a different value for getppid() while being traced
1104+
* by a debugger.
1105+
*/
10981106
set->report_postmaster_not_running= true;
1107+
}
10991108
}
11001109

11011110
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp