1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00

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().
This commit is contained in:
Noah Misch
2014-07-25 18:51:48 -04:00
parent e565ff7553
commit de35a97710
2 changed files with 37 additions and 24 deletions

View File

@@ -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;