forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8e19a82
committed
Don't run atexit callbacks in quickdie signal handlers.
exit() is not async-signal safe. Even if the libc implementation is, 3rdparty libraries might have installed unsafe atexit() callbacks. Afterreceiving SIGQUIT, we really just want to exit as quickly as possible, sowe don't really want to run the atexit() callbacks anyway.The original report by Jimmy Yih was a self-deadlock in startup_die().However, this patch doesn't address that scenario; the signal handlingwhile waiting for the startup packet is more complicated. But at least thisalleviates similar problems in the SIGQUIT handlers, like that reportedby Asim R P later in the same thread.Backpatch to 9.3 (all supported versions).Discussion:https://www.postgresql.org/message-id/CAOMx_OAuRUHiAuCg2YgicZLzPVv5d9_H4KrL_OFsFP%3DVPekigA%40mail.gmail.com1 parent11e22e4 commit8e19a82
File tree
7 files changed
+77
-108
lines changed- src/backend
- postmaster
- replication
- tcop
7 files changed
+77
-108
lines changedLines changed: 9 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
644 | 644 |
| |
645 | 645 |
| |
646 | 646 |
| |
647 |
| - | |
648 |
| - | |
649 |
| - | |
650 |
| - | |
651 |
| - | |
652 |
| - | |
653 |
| - | |
654 |
| - | |
655 |
| - | |
656 |
| - | |
657 |
| - | |
658 |
| - | |
659 |
| - | |
660 | 647 |
| |
661 |
| - | |
662 |
| - | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
663 | 656 |
| |
664 | 657 |
| |
665 | 658 |
| |
666 | 659 |
| |
667 | 660 |
| |
668 |
| - | |
| 661 | + | |
669 | 662 |
| |
670 | 663 |
| |
671 | 664 |
| |
|
Lines changed: 9 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
399 | 399 |
| |
400 | 400 |
| |
401 | 401 |
| |
402 |
| - | |
403 |
| - | |
404 | 402 |
| |
405 |
| - | |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
410 |
| - | |
411 |
| - | |
412 |
| - | |
413 |
| - | |
414 |
| - | |
415 |
| - | |
416 |
| - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
417 | 411 |
| |
418 | 412 |
| |
419 | 413 |
| |
420 | 414 |
| |
421 | 415 |
| |
422 |
| - | |
| 416 | + | |
423 | 417 |
| |
424 | 418 |
| |
425 | 419 |
| |
|
Lines changed: 9 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
813 | 813 |
| |
814 | 814 |
| |
815 | 815 |
| |
816 |
| - | |
817 |
| - | |
818 | 816 |
| |
819 |
| - | |
820 |
| - | |
821 |
| - | |
822 |
| - | |
823 |
| - | |
824 |
| - | |
825 |
| - | |
826 |
| - | |
827 |
| - | |
828 |
| - | |
829 |
| - | |
830 |
| - | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
831 | 825 |
| |
832 | 826 |
| |
833 | 827 |
| |
834 | 828 |
| |
835 | 829 |
| |
836 |
| - | |
| 830 | + | |
837 | 831 |
| |
838 | 832 |
| |
839 | 833 |
| |
|
Lines changed: 9 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 | 72 |
| |
85 |
| - | |
86 |
| - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
87 | 81 |
| |
88 | 82 |
| |
89 | 83 |
| |
90 | 84 |
| |
91 | 85 |
| |
92 |
| - | |
| 86 | + | |
93 | 87 |
| |
94 | 88 |
| |
95 | 89 |
| |
|
Lines changed: 9 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
312 |
| - | |
313 |
| - | |
314 | 312 |
| |
315 |
| - | |
316 |
| - | |
317 |
| - | |
318 |
| - | |
319 |
| - | |
320 |
| - | |
321 |
| - | |
322 |
| - | |
323 |
| - | |
324 |
| - | |
325 |
| - | |
326 |
| - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
327 | 321 |
| |
328 | 322 |
| |
329 | 323 |
| |
330 | 324 |
| |
331 | 325 |
| |
332 |
| - | |
| 326 | + | |
333 | 327 |
| |
334 | 328 |
| |
335 | 329 |
| |
|
Lines changed: 13 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
854 | 854 |
| |
855 | 855 |
| |
856 | 856 |
| |
857 |
| - | |
858 |
| - | |
859 | 857 |
| |
860 |
| - | |
861 |
| - | |
862 |
| - | |
863 |
| - | |
864 |
| - | |
865 |
| - | |
866 |
| - | |
867 |
| - | |
868 |
| - | |
869 |
| - | |
870 |
| - | |
871 |
| - | |
872 |
| - | |
873 |
| - | |
874 |
| - | |
875 |
| - | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
876 | 870 |
| |
877 |
| - | |
| 871 | + | |
878 | 872 |
| |
879 | 873 |
| |
880 | 874 |
| |
|
Lines changed: 19 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2616 | 2616 |
| |
2617 | 2617 |
| |
2618 | 2618 |
| |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
2619 | 2629 |
| |
2620 | 2630 |
| |
2621 | 2631 |
| |
| |||
2630 | 2640 |
| |
2631 | 2641 |
| |
2632 | 2642 |
| |
2633 |
| - | |
2634 |
| - | |
2635 |
| - | |
2636 |
| - | |
2637 |
| - | |
2638 |
| - | |
2639 |
| - | |
2640 |
| - | |
2641 |
| - | |
2642 |
| - | |
2643 |
| - | |
2644 |
| - | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
2645 | 2651 |
| |
2646 | 2652 |
| |
2647 | 2653 |
| |
2648 | 2654 |
| |
2649 | 2655 |
| |
2650 |
| - | |
| 2656 | + | |
2651 | 2657 |
| |
2652 | 2658 |
| |
2653 | 2659 |
| |
|
0 commit comments
Comments
(0)