From: | Robert Haas <rhaas(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix corner-case bug in WaitEventSetWaitBlock on Windows. |
Date: | 2016-12-21 16:15:07 |
Message-ID: | E1cJjXn-0007RM-PI@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix corner-case bug in WaitEventSetWaitBlock on Windows.
If we do not reset the FD_READ event, WaitForMultipleObjects won't
return it again again unless we've meanwhile read from the socket,
which is generally true but not guaranteed. WaitEventSetWaitBlock
itself may fail to return the event to the caller if the latch is
also set, and even if we changed that, the caller isn't obliged to
handle all returned events at once. On non-Windows systems, the
socket-read event is purely level-triggered, so this issue does
not exist. To fix, make Windows reset the event when needed.
This bug was introduced by 98a64d0bd713cb89e61bef6432befc4b7b5da59e,
and causes hangs when trying to use the pldebugger extension.
Patch by Amit Kapial. Reported and tested by Ashutosh Sharma, who
also provided some analysis. Further analysis by Michael Paquier.
Branch
------
REL9_6_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/b98e5513f33154ede701963ee9115ea056e9dea9
Modified Files
--------------
src/backend/storage/ipc/latch.c | 27 +++++++++++++++++++++++++++
src/include/storage/latch.h | 3 +++
2 files changed, 30 insertions(+)
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2016-12-21 16:39:18 | pgsql: Refactor partition tuple routing code to reduce duplication. |
Previous Message | Robert Haas | 2016-12-21 15:31:18 | Re: [COMMITTERS] pgsql: Implement table partitioning. |