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

Commitb2b4af5

Browse files
committed
Fix poll() implementation of WaitLatchOrSocket to notice postmaster death.
When the remote end of the pipe is closed, select() reports the fd asreadable, but poll() has a separate POLLHUP return code for that.Spotted by Peter Geoghegan.
1 parent0495aaa commitb2b4af5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/backend/port/unix_latch.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,13 @@ WaitLatchOrSocket(volatile Latch *latch, int wakeEvents, pgsocket sock,
310310
{
311311
result |=WL_SOCKET_WRITEABLE;
312312
}
313+
/*
314+
* We expect a POLLHUP when the remote end is closed, but because we
315+
* don't expect the pipe to become readable or to have any errors
316+
* either, treat those as postmaster death, too.
317+
*/
313318
if ((wakeEvents&WL_POSTMASTER_DEATH)&&
314-
(pfds[nfds-1].revents&POLLIN))
319+
(pfds[nfds-1].revents&(POLLHUP |POLLIN |POLLERR |POLLNVAL)))
315320
{
316321
result |=WL_POSTMASTER_DEATH;
317322
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp