forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0cfc67b
committed
Add HOLD/RESUME_INTERRUPTS in HandleCatchupInterrupt/HandleNotifyInterrupt.
This prevents a possible longjmp out of the signal handler if a timeoutor SIGINT occurs while something within the handler has transiently setImmediateInterruptOK. For safety we must hold off the timeout or cancelerror until we're back in mainline, or at least till we reach the end ofthe signal handler when ImmediateInterruptOK was true at entry. Thissyncs these functions with the logic now present in handle_sig_alarm.AFAICT there is no live bug here in 9.0 and up, because I don't think wecurrently can wait for any heavyweight lock inside these functions, andthere is no other code (except read-from-client) that will turn onImmediateInterruptOK. However, that was not true pre-9.0: in olderbranches ProcessIncomingNotify might block trying to lock pg_listener, andthen a SIGINT could lead to undesirable control flow. It might be allright anyway given the relatively narrow code ranges in which NOTIFYinterrupts are enabled, but for safety's sake I'm back-patching this.1 parent478af9b commit0cfc67b
2 files changed
+20
-8
lines changedLines changed: 10 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1652 | 1652 |
| |
1653 | 1653 |
| |
1654 | 1654 |
| |
1655 |
| - | |
1656 |
| - | |
1657 |
| - | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
1658 | 1661 |
| |
1659 | 1662 |
| |
| 1663 | + | |
1660 | 1664 |
| |
1661 | 1665 |
| |
1662 | 1666 |
| |
| |||
1686 | 1690 |
| |
1687 | 1691 |
| |
1688 | 1692 |
| |
1689 |
| - | |
| 1693 | + | |
| 1694 | + | |
1690 | 1695 |
| |
| 1696 | + | |
1691 | 1697 |
| |
1692 | 1698 |
| |
1693 | 1699 |
| |
|
Lines changed: 10 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
180 | 180 |
| |
181 | 181 |
| |
182 | 182 |
| |
183 |
| - | |
184 |
| - | |
185 |
| - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
186 | 189 |
| |
187 | 190 |
| |
| 191 | + | |
188 | 192 |
| |
189 | 193 |
| |
190 | 194 |
| |
| |||
208 | 212 |
| |
209 | 213 |
| |
210 | 214 |
| |
211 |
| - | |
| 215 | + | |
| 216 | + | |
212 | 217 |
| |
| 218 | + | |
213 | 219 |
| |
214 | 220 |
| |
215 | 221 |
| |
|
0 commit comments
Comments
(0)