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

Commitf1ca515

Browse files
committed
Force pgwin32_recv into nonblock mode when called from pgstat.c.
This should get rid of the usage of pgwin32_waitforsinglesocket entirely,and perhaps thereby remove the race condition that's evidently stillpresent on some versions of Windows. The previous arrangement was a bitunsafe anyway, since waiting at the recv() would not allow pgstat to noticepostmaster death.
1 parentf15c2ea commitf1ca515

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3117,9 +3117,21 @@ PgstatCollectorMain(int argc, char *argv[])
31173117
/*
31183118
* Try to receive and process a message. This will not block,
31193119
* since the socket is set to non-blocking mode.
3120+
*
3121+
* XXX On Windows, we have to force pgwin32_recv to cooperate.
3122+
* This is extremely broken and should be fixed someday.
31203123
*/
3124+
#ifdefWIN32
3125+
pgwin32_noblock=1;
3126+
#endif
3127+
31213128
len=recv(pgStatSock, (char*)&msg,
31223129
sizeof(PgStat_Msg),0);
3130+
3131+
#ifdefWIN32
3132+
pgwin32_noblock=0;
3133+
#endif
3134+
31233135
if (len<0)
31243136
{
31253137
if (errno==EAGAIN||errno==EWOULDBLOCK||errno==EINTR)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp