- Notifications
You must be signed in to change notification settings - Fork5
Commitf7819ba
committed
Fix WaitEventSetWait() to handle write-ready waits properly on Windows.
Windows apparently will not detect socket write-ready events unless apreceding send attempt returned WSAEWOULDBLOCK. In many usage patternsthat's satisfied by the caller of WaitEvenSetWait(), but not always.Apply the same solution that we already had in pgwin32_select(), namely toperform a dummy WSASend() call with len=0. This will return WSAEWOULDBLOCKif there's no buffer space (even though it could legitimately do nothingand report success, which makes me a bit nervous about this solution;but since it's been working fine in libpq, let's roll with it).In passing, improve the comments about this in pgwin32_select(), and removeduplicated code there.Back-patch to 9.6 where WaitEventSetWait() was introduced. We might needto back-patch something similar into predecessor code. But given the lackof complaints so far, it's not clear that the case ever gets exercisedin the back branches, so I'm not going to expend effort on it right now.This should resolve recurring failures on buildfarm member bowerbird,which has been failing since1e8a850 went in.Diagnosis and patch by Petr Jelinek, cosmetic adjustments by me.Discussion:https://postgr.es/m/5b6a6d6d-fb45-0afb-2e95-5600063c3dbd@2ndquadrant.com1 parentfef2bcd commitf7819ba
2 files changed
+44
-16
lines changedLines changed: 12 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
523 | 523 |
| |
524 | 524 |
| |
525 | 525 |
| |
526 |
| - | |
527 |
| - | |
528 |
| - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
529 | 534 |
| |
530 |
| - | |
| 535 | + | |
531 | 536 |
| |
532 | 537 |
| |
533 | 538 |
| |
| |||
539 | 544 |
| |
540 | 545 |
| |
541 | 546 |
| |
542 |
| - | |
| 547 | + | |
543 | 548 |
| |
544 |
| - | |
545 |
| - | |
546 |
| - | |
547 |
| - | |
548 |
| - | |
549 |
| - | |
550 |
| - | |
551 |
| - | |
552 |
| - | |
553 |
| - | |
554 |
| - | |
555 | 549 |
| |
| 550 | + | |
| 551 | + | |
556 | 552 |
| |
557 | 553 |
| |
558 | 554 |
| |
|
Lines changed: 32 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1401 | 1401 |
| |
1402 | 1402 |
| |
1403 | 1403 |
| |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
1404 | 1436 |
| |
1405 | 1437 |
| |
1406 | 1438 |
| |
|
0 commit comments
Comments
(0)