aboutsummaryrefslogtreecommitdiff
path: root/src/backend/port/win32/socket.c
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2014-07-25 18:51:48 -0400
committerNoah Misch <noah@leadboat.com>2014-07-25 18:51:48 -0400
commitde35a9771004b9d521c9d5882db6be4fba20e80e (patch)
treea223bba7bc921b2bef51a443fa6d5670fd5c4852 /src/backend/port/win32/socket.c
parente565ff7553e60b3d13dde410ef96f5256c5525eb (diff)
downloadpostgresql-de35a9771004b9d521c9d5882db6be4fba20e80e.tar.gz
postgresql-de35a9771004b9d521c9d5882db6be4fba20e80e.zip
Handle WAIT_IO_COMPLETION return from WaitForMultipleObjectsEx().
This return code is possible wherever we pass bAlertable = TRUE; it arises when Windows caused the current thread to run an "I/O completion routine" or an "asynchronous procedure call". PostgreSQL does not provoke either of those Windows facilities, hence this bug remaining largely unnoticed, but other local code might do so. Due to a shortage of complaints, no back-patch for now. Per report from Shiv Shivaraju Gowda, this bug can cause PGSemaphoreLock() to PANIC. The bug can also cause select() to report timeout expiration too early, which might confuse pgstat_init() and CheckRADIUSAuth().
Diffstat (limited to 'src/backend/port/win32/socket.c')
-rw-r--r--src/backend/port/win32/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/port/win32/socket.c b/src/backend/port/win32/socket.c
index 6a518e5b6d9..c981169fe1f 100644
--- a/src/backend/port/win32/socket.c
+++ b/src/backend/port/win32/socket.c
@@ -623,7 +623,8 @@ pgwin32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, c
return 0;
}
- if (r == WAIT_OBJECT_0 + numevents)
+ /* Signal-like events. */
+ if (r == WAIT_OBJECT_0 + numevents || r == WAIT_IO_COMPLETION)
{
pgwin32_dispatch_queued_signals();
errno = EINTR;