forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3b790d2
committed
Fix corner-case bug in WaitEventSetWaitBlock on Windows.
If we do not reset the FD_READ event, WaitForMultipleObjects won'treturn it again again unless we've meanwhile read from the socket,which is generally true but not guaranteed. WaitEventSetWaitBlockitself may fail to return the event to the caller if the latch isalso set, and even if we changed that, the caller isn't obliged tohandle all returned events at once. On non-Windows systems, thesocket-read event is purely level-triggered, so this issue doesnot exist. To fix, make Windows reset the event when needed.This bug was introduced by98a64d0,and causes hangs when trying to use the pldebugger extension.Patch by Amit Kapial. Reported and tested by Ashutosh Sharma, whoalso provided some analysis. Further analysis by Michael Paquier.1 parent59649c3 commit3b790d2
2 files changed
+30
-0
lines changedLines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
643 | 643 |
| |
644 | 644 |
| |
645 | 645 |
| |
| 646 | + | |
| 647 | + | |
| 648 | + | |
646 | 649 |
| |
647 | 650 |
| |
648 | 651 |
| |
| |||
1389 | 1392 |
| |
1390 | 1393 |
| |
1391 | 1394 |
| |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
1392 | 1407 |
| |
1393 | 1408 |
| |
1394 | 1409 |
| |
| |||
1472 | 1487 |
| |
1473 | 1488 |
| |
1474 | 1489 |
| |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
1475 | 1502 |
| |
1476 | 1503 |
| |
1477 | 1504 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
133 | 133 |
| |
134 | 134 |
| |
135 | 135 |
| |
| 136 | + | |
| 137 | + | |
| 138 | + | |
136 | 139 |
| |
137 | 140 |
| |
138 | 141 |
| |
|
0 commit comments
Comments
(0)