forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit2843c01
committed
Report an ERROR if a parallel worker fails to start properly.
Commit28724fd fixed things so thatif a background worker fails to start due to fork() failure or becauseit is terminated before startup succeeds, BGWH_STOPPED will bereported. However, that only helps if the code that uses thebackground worker machinery notices the change in status, and the codein parallel.c did not.To fix that, do two things. First, make sure that when a workerexits, it triggers the leader to read from error queues. That way, ifa worker which has attached to an error queue exits uncleanly, theleader is sure to throw some error, either the contents of theErrorResponse sent by the worker, or "lost connection to parallelworker" if it exited without sending one. To cover the case wherethe worker never starts up in the first place or exits beforeattaching to the error queue, the ParallelContext now keeps trackof which workers have sent at least one message via the errorqueue. A worker which sends no messages by the time the paralleloperation finishes will be checked to see whether it exited beforeattaching to the error queue; if so, a new error message, "parallelworker failed to initialize", will be reported. If not, we'llcontinue to wait until it either starts up and exits cleanly, startsup and exits uncleanly, or fails to start, and then take theappropriate action.Patch by me, reviewed by Amit Kapila.Discussion:http://postgr.es/m/CA+TgmoYnBgXgdTu6wk5YPdWhmgabYc9nY_pFLq=tB=FSLYkD8Q@mail.gmail.com1 parentcda1ba3 commit2843c01
File tree
2 files changed
+110
-9
lines changed- src
- backend/access/transam
- include/access
2 files changed
+110
-9
lines changedLines changed: 109 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
109 | 109 |
| |
110 | 110 |
| |
111 | 111 |
| |
| 112 | + | |
| 113 | + | |
| 114 | + | |
112 | 115 |
| |
113 | 116 |
| |
114 | 117 |
| |
| |||
129 | 132 |
| |
130 | 133 |
| |
131 | 134 |
| |
| 135 | + | |
132 | 136 |
| |
133 | 137 |
| |
134 | 138 |
| |
| |||
427 | 431 |
| |
428 | 432 |
| |
429 | 433 |
| |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
430 | 439 |
| |
431 | 440 |
| |
432 | 441 |
| |
| |||
523 | 532 |
| |
524 | 533 |
| |
525 | 534 |
| |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
526 | 543 |
| |
527 | 544 |
| |
528 | 545 |
| |
| |||
544 | 561 |
| |
545 | 562 |
| |
546 | 563 |
| |
| 564 | + | |
547 | 565 |
| |
548 | 566 |
| |
549 | 567 |
| |
| |||
555 | 573 |
| |
556 | 574 |
| |
557 | 575 |
| |
558 |
| - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
559 | 585 |
| |
560 | 586 |
| |
561 | 587 |
| |
562 | 588 |
| |
563 | 589 |
| |
564 | 590 |
| |
565 | 591 |
| |
566 |
| - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
567 | 648 |
| |
568 | 649 |
| |
569 | 650 |
| |
| |||
821 | 902 |
| |
822 | 903 |
| |
823 | 904 |
| |
| 905 | + | |
| 906 | + | |
| 907 | + | |
824 | 908 |
| |
825 | 909 |
| |
826 | 910 |
| |
| |||
1014 | 1098 |
| |
1015 | 1099 |
| |
1016 | 1100 |
| |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1017 | 1106 |
| |
1018 |
| - | |
1019 |
| - | |
1020 |
| - | |
1021 |
| - | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
1022 | 1111 |
| |
1023 | 1112 |
| |
1024 | 1113 |
| |
| |||
1144 | 1233 |
| |
1145 | 1234 |
| |
1146 | 1235 |
| |
1147 |
| - | |
1148 |
| - | |
1149 |
| - | |
1150 | 1236 |
| |
1151 | 1237 |
| |
1152 | 1238 |
| |
| |||
1192 | 1278 |
| |
1193 | 1279 |
| |
1194 | 1280 |
| |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
1195 | 1295 |
| |
1196 | 1296 |
| |
1197 | 1297 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
| 47 | + | |
47 | 48 |
| |
48 | 49 |
| |
49 | 50 |
| |
|
0 commit comments
Comments
(0)