forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8b53dba
committed
In the postmaster, rely on the signal infrastructure to block signals.
POSIX sigaction(2) can be told to block a set of signals while asignal handler executes. Make use of that instead of manuallyblocking and unblocking signals in the postmaster's signal handlers.This should save a few cycles, but more importantly it preventsrecursive invocation of signal handlers when many signals arrive inclose succession. (Assuming that the platform's signal infrastructureis designed to avoid consuming stack space in that case, but this isdemonstrably true at least on Linux.) The existing code has been seento recurse to the point of stack overflow, either in the postmasteror in a forked-off child.Back-patch of commit9abb2bf. At the time, we'd only seen excesspostmaster stack consumption in the buildfarm; but we now have auser report of it, and that commit has aged enough to have a fairamount of confidence that it doesn't break anything.This still doesn't change anything about the way that it works onWindows. Perhaps someone else would like to fix that?Per bug #16673 from David Geier. Back-patch to 9.6. Althoughthe problem exists in principle before that, we've only seen itactually materialize in connection with heavy use of parallelworkers, so it doesn't seem necessary to do anything in 9.5;and the relevant code is different there, too.Discussion:https://postgr.es/m/16673-d278c604f8e34ec0@postgresql.orgDiscussion:https://postgr.es/m/14878.1570820201@sss.pgh.pa.us1 parent72b1574 commit8b53dba
File tree
5 files changed
+116
-57
lines changed- src
- backend
- libpq
- postmaster
- include
- libpq
- port
5 files changed
+116
-57
lines changedLines changed: 49 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + |
Lines changed: 64 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
618 | 618 |
| |
619 | 619 |
| |
620 | 620 |
| |
621 |
| - | |
622 |
| - | |
623 |
| - | |
624 |
| - | |
625 |
| - | |
626 |
| - | |
627 |
| - | |
628 |
| - | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
629 | 640 |
| |
630 | 641 |
| |
631 | 642 |
| |
| |||
637 | 648 |
| |
638 | 649 |
| |
639 | 650 |
| |
640 |
| - | |
641 |
| - | |
642 |
| - | |
643 |
| - | |
644 |
| - | |
645 |
| - | |
646 |
| - | |
647 |
| - | |
648 |
| - | |
649 |
| - | |
650 |
| - | |
651 |
| - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
652 | 661 |
| |
653 | 662 |
| |
654 | 663 |
| |
| |||
658 | 667 |
| |
659 | 668 |
| |
660 | 669 |
| |
661 |
| - | |
| 670 | + | |
662 | 671 |
| |
663 | 672 |
| |
664 |
| - | |
| 673 | + | |
665 | 674 |
| |
666 | 675 |
| |
667 | 676 |
| |
668 | 677 |
| |
669 |
| - | |
| 678 | + | |
670 | 679 |
| |
671 | 680 |
| |
672 | 681 |
| |
| |||
2655 | 2664 |
| |
2656 | 2665 |
| |
2657 | 2666 |
| |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
2658 | 2672 |
| |
| 2673 | + | |
2659 | 2674 |
| |
2660 | 2675 |
| |
2661 | 2676 |
| |
| |||
2715 | 2730 |
| |
2716 | 2731 |
| |
2717 | 2732 |
| |
| 2733 | + | |
2718 | 2734 |
| |
| 2735 | + | |
2719 | 2736 |
| |
2720 | 2737 |
| |
2721 | 2738 |
| |
| |||
2729 | 2746 |
| |
2730 | 2747 |
| |
2731 | 2748 |
| |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
2732 | 2754 |
| |
| 2755 | + | |
2733 | 2756 |
| |
2734 | 2757 |
| |
2735 | 2758 |
| |
| |||
2858 | 2881 |
| |
2859 | 2882 |
| |
2860 | 2883 |
| |
| 2884 | + | |
2861 | 2885 |
| |
| 2886 | + | |
2862 | 2887 |
| |
2863 | 2888 |
| |
2864 | 2889 |
| |
| |||
2873 | 2898 |
| |
2874 | 2899 |
| |
2875 | 2900 |
| |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
2876 | 2906 |
| |
| 2907 | + | |
2877 | 2908 |
| |
2878 | 2909 |
| |
2879 | 2910 |
| |
| |||
3176 | 3207 |
| |
3177 | 3208 |
| |
3178 | 3209 |
| |
| 3210 | + | |
3179 | 3211 |
| |
| 3212 | + | |
3180 | 3213 |
| |
3181 | 3214 |
| |
3182 | 3215 |
| |
| |||
5110 | 5143 |
| |
5111 | 5144 |
| |
5112 | 5145 |
| |
| 5146 | + | |
| 5147 | + | |
| 5148 | + | |
| 5149 | + | |
| 5150 | + | |
5113 | 5151 |
| |
| 5152 | + | |
5114 | 5153 |
| |
5115 | 5154 |
| |
5116 | 5155 |
| |
| |||
5270 | 5309 |
| |
5271 | 5310 |
| |
5272 | 5311 |
| |
| 5312 | + | |
5273 | 5313 |
| |
| 5314 | + | |
5274 | 5315 |
| |
5275 | 5316 |
| |
5276 | 5317 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 |
|
Lines changed: 0 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
524 | 524 |
| |
525 | 525 |
| |
526 | 526 |
| |
527 |
| - | |
528 |
| - | |
529 |
| - | |
530 |
| - | |
531 |
| - | |
532 | 527 |
| |
533 | 528 |
| |
534 | 529 |
| |
|
Lines changed: 0 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 | 61 |
|
0 commit comments
Comments
(0)