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

Commit31ad655

Browse files
committed
Fix WaitLatchOrSocket to handle EOF on socket correctly.
When using poll(), EOF on a socket is reported with the POLLHUP notPOLLIN flag (at least on Linux). WaitLatchOrSocket failed to checkthis bit, causing it to go into a busy-wait loop if EOF occurs.We earlier fixed the same mistake in the test for the state of thepostmaster_alive socket, but missed it for the caller-supplied socket.Fortunately, this error is new in 9.2, since 9.1 only had a select()based code path not a poll() based one.
1 parentd36eaa2 commit31ad655

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/port/unix_latch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ WaitLatchOrSocket(volatile Latch *latch, int wakeEvents, pgsocket sock,
293293
result |=WL_TIMEOUT;
294294
}
295295
if ((wakeEvents&WL_SOCKET_READABLE)&&
296-
(pfds[0].revents&POLLIN))
296+
(pfds[0].revents&(POLLIN |POLLHUP |POLLERR |POLLNVAL)))
297297
{
298298
/* data available in socket */
299299
result |=WL_SOCKET_READABLE;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp