forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit239b175
committed
Process pending postmaster work before connections.
Modify the new event loop code from commit7389aad so that it checksfor work requested by signal handlers even if it doesn't see a latchevent yet.This gives priority to shutdown and reload requests where the latch willbe reported later in the event array, or in a later call toWaitEventSetWait(), due to scheduling details. In particular, thisguarantees that a SIGHUP-then-connect sequence (as seen inauthentication tests) causes the postmaster to process the reload beforeaccepting the connection. If the WaitEventSetWait() call saw the socketas ready, and the reload signal was generated before the connection,then the latest time the signal handler should be able to run is afterpoll/epoll_wait/kevent returns but before we check thepending_pm_reload_request flag.While here, also shift the handling of child exit below reload requests,per Tom Lane's observation that that might start new processes, so weshould make sure we pick up new settings first.This probably explains the one-off failure of build farm animalmalleefowl.Reported-by: Hou Zhijie <houzj.fnst@fujitsu.com>Reported-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/OS0PR01MB57163D3BF2AB42ECAA94E5C394C29%40OS0PR01MB5716.jpnprd01.prod.outlook.com1 parent8f8f115 commit239b175
1 file changed
+17
-12
lines changedLines changed: 17 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1750 | 1750 |
| |
1751 | 1751 |
| |
1752 | 1752 |
| |
1753 |
| - | |
1754 | 1753 |
| |
1755 | 1754 |
| |
1756 |
| - | |
1757 |
| - | |
1758 |
| - | |
1759 |
| - | |
1760 |
| - | |
1761 |
| - | |
1762 |
| - | |
1763 |
| - | |
1764 |
| - | |
1765 |
| - | |
1766 |
| - | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
1767 | 1772 |
| |
1768 | 1773 |
| |
1769 | 1774 |
| |
|
0 commit comments
Comments
(0)