forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3b90e38
committed
Do ClosePostmasterPorts() earlier in SubPostmasterMain().
In standard Unix builds, postmaster child processes do ClosePostmasterPortsimmediately after InitPostmasterChild, that is almost immediately afterbeing spawned. This is important because we don't want children holdingopen the postmaster's end of the postmaster death watch pipe.However, in EXEC_BACKEND builds, SubPostmasterMain was postponing thisresponsibility significantly, in order to make it slightly more convenientto pass the right flag value to ClosePostmasterPorts. This is bad,particularly seeing that process_shared_preload_libraries() might invokenearly-arbitrary code. Rearrange so that we do it as soon as we'vefetched the socket FDs via read_backend_variables().Also move the comment explaining about randomize_va_space to before thecall of PGSharedMemoryReAttach, which is where it's relevant. The oldplacement was appropriate when the reattach happened insideCreateSharedMemoryAndSemaphores, but that was a long time ago.Back-patch to 9.3; the patch doesn't apply cleanly before that, andit doesn't seem worth a lot of effort given that we've had no actualfield complaints traceable to this.Discussion: <4157.1475178360@sss.pgh.pa.us>1 parent9a10945 commit3b90e38
1 file changed
+18
-39
lines changedLines changed: 18 additions & 39 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4635 | 4635 |
| |
4636 | 4636 |
| |
4637 | 4637 |
| |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
| 4641 | + | |
4638 | 4642 |
| |
4639 | 4643 |
| |
4640 | 4644 |
| |
4641 | 4645 |
| |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
4642 | 4649 |
| |
4643 | 4650 |
| |
4644 | 4651 |
| |
| |||
4656 | 4663 |
| |
4657 | 4664 |
| |
4658 | 4665 |
| |
4659 |
| - | |
4660 |
| - | |
4661 |
| - | |
4662 |
| - | |
4663 | 4666 |
| |
4664 | 4667 |
| |
4665 | 4668 |
| |
4666 | 4669 |
| |
4667 | 4670 |
| |
| 4671 | + | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
| 4675 | + | |
| 4676 | + | |
| 4677 | + | |
| 4678 | + | |
| 4679 | + | |
| 4680 | + | |
4668 | 4681 |
| |
4669 | 4682 |
| |
4670 | 4683 |
| |
| |||
4710 | 4723 |
| |
4711 | 4724 |
| |
4712 | 4725 |
| |
4713 |
| - | |
4714 |
| - | |
4715 |
| - | |
4716 | 4726 |
| |
4717 | 4727 |
| |
4718 | 4728 |
| |
| |||
4743 | 4753 |
| |
4744 | 4754 |
| |
4745 | 4755 |
| |
4746 |
| - | |
4747 |
| - | |
4748 |
| - | |
4749 |
| - | |
4750 |
| - | |
4751 |
| - | |
4752 |
| - | |
4753 |
| - | |
4754 |
| - | |
4755 |
| - | |
4756 |
| - | |
| 4756 | + | |
4757 | 4757 |
| |
4758 | 4758 |
| |
4759 | 4759 |
| |
4760 | 4760 |
| |
4761 | 4761 |
| |
4762 | 4762 |
| |
4763 | 4763 |
| |
4764 |
| - | |
4765 |
| - | |
4766 |
| - | |
4767 | 4764 |
| |
4768 | 4765 |
| |
4769 | 4766 |
| |
| |||
4777 | 4774 |
| |
4778 | 4775 |
| |
4779 | 4776 |
| |
4780 |
| - | |
4781 |
| - | |
4782 |
| - | |
4783 | 4777 |
| |
4784 | 4778 |
| |
4785 | 4779 |
| |
| |||
4793 | 4787 |
| |
4794 | 4788 |
| |
4795 | 4789 |
| |
4796 |
| - | |
4797 |
| - | |
4798 |
| - | |
4799 | 4790 |
| |
4800 | 4791 |
| |
4801 | 4792 |
| |
| |||
4814 | 4805 |
| |
4815 | 4806 |
| |
4816 | 4807 |
| |
4817 |
| - | |
4818 |
| - | |
4819 |
| - | |
4820 | 4808 |
| |
4821 | 4809 |
| |
4822 | 4810 |
| |
| |||
4834 | 4822 |
| |
4835 | 4823 |
| |
4836 | 4824 |
| |
4837 |
| - | |
4838 |
| - | |
4839 |
| - | |
4840 | 4825 |
| |
4841 | 4826 |
| |
4842 | 4827 |
| |
4843 | 4828 |
| |
4844 | 4829 |
| |
4845 | 4830 |
| |
4846 |
| - | |
4847 |
| - | |
4848 |
| - | |
4849 | 4831 |
| |
4850 | 4832 |
| |
4851 | 4833 |
| |
4852 | 4834 |
| |
4853 | 4835 |
| |
4854 | 4836 |
| |
4855 |
| - | |
4856 |
| - | |
4857 |
| - | |
4858 | 4837 |
| |
4859 | 4838 |
| |
4860 | 4839 |
| |
|
0 commit comments
Comments
(0)