forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd41a178
committed
Fix waitpid() emulation on Windows.
Our waitpid() emulation didn't prevent a PID from being recycled by theOS before the call to waitpid(). The postmaster could finish uptracking more than one child process with the same PID, and confusethem.Fix, by moving the guts of pgwin32_deadchild_callback() into waitpid(),so that resources are released synchronously. The process and PIDcontinue to exist until we close the process handle, which only happensonce we're ready to adjust our book-keeping of running children.This seems to explain a couple of failures on CI. It had never beenreported before, despite the code being as old as the Windows port.Perhaps Windows started recycling PIDs more rapidly, or perhaps timingchanges due to commit7389aad made it more likely to break.Thanks to Alexander Lakhin for analysis and Andres Freund for trackingdown the root cause.Back-patch to all supported branches.Reported-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/20230208012852.bvkn2am4h4iqjogq%40awork3.anarazel.de1 parentb081fe4 commitd41a178
1 file changed
+40
-30
lines changedLines changed: 40 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4811 | 4811 |
| |
4812 | 4812 |
| |
4813 | 4813 |
| |
4814 |
| - | |
| 4814 | + | |
4815 | 4815 |
| |
4816 | 4816 |
| |
4817 | 4817 |
| |
| |||
6421 | 6421 |
| |
6422 | 6422 |
| |
6423 | 6423 |
| |
| 6424 | + | |
| 6425 | + | |
6424 | 6426 |
| |
6425 | 6427 |
| |
6426 | 6428 |
| |
6427 | 6429 |
| |
6428 |
| - | |
6429 |
| - | |
6430 |
| - | |
6431 |
| - | |
6432 |
| - | |
| 6430 | + | |
| 6431 | + | |
6433 | 6432 |
| |
6434 |
| - | |
6435 |
| - | |
| 6433 | + | |
| 6434 | + | |
6436 | 6435 |
| |
6437 | 6436 |
| |
6438 |
| - | |
6439 |
| - | |
6440 |
| - | |
6441 |
| - | |
6442 |
| - | |
6443 |
| - | |
6444 |
| - | |
6445 |
| - | |
6446 |
| - | |
6447 |
| - | |
6448 |
| - | |
6449 |
| - | |
6450 |
| - | |
6451 |
| - | |
6452 |
| - | |
6453 |
| - | |
| 6437 | + | |
| 6438 | + | |
6454 | 6439 |
| |
6455 | 6440 |
| |
6456 | 6441 |
| |
| |||
6466 | 6451 |
| |
6467 | 6452 |
| |
6468 | 6453 |
| |
6469 |
| - | |
6470 |
| - | |
6471 |
| - | |
| 6454 | + | |
6472 | 6455 |
| |
6473 | 6456 |
| |
6474 |
| - | |
6475 |
| - | |
| 6457 | + | |
| 6458 | + | |
6476 | 6459 |
| |
6477 | 6460 |
| |
6478 | 6461 |
| |
| |||
6482 | 6465 |
| |
6483 | 6466 |
| |
6484 | 6467 |
| |
6485 |
| - | |
| 6468 | + | |
| 6469 | + | |
| 6470 | + | |
| 6471 | + | |
| 6472 | + | |
| 6473 | + | |
| 6474 | + | |
| 6475 | + | |
| 6476 | + | |
| 6477 | + | |
| 6478 | + | |
| 6479 | + | |
| 6480 | + | |
| 6481 | + | |
| 6482 | + | |
| 6483 | + | |
| 6484 | + | |
| 6485 | + | |
| 6486 | + | |
| 6487 | + | |
| 6488 | + | |
| 6489 | + | |
| 6490 | + | |
| 6491 | + | |
| 6492 | + | |
| 6493 | + | |
| 6494 | + | |
| 6495 | + | |
6486 | 6496 |
| |
6487 | 6497 |
| |
6488 | 6498 |
| |
|
0 commit comments
Comments
(0)