forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2a08477
committed
Use standard SIGHUP and SIGTERM signal handlers in worker_spi.
Previously worker_spi used its custom signal handlers for SIGHUP andSIGTERM. This commit makes worker_spi use the standard signal handlers,to simplify the code.Note that die() is used as the standard SIGTERM signal handler inworker_spi instead of SignalHandlerForShutdownRequest() or bgworker_die().Previously the exit handling was only able to exit from within the main loop,and not from within the backend code it calls. This is why die() needs tobe used here, so worker_spi can respond to SIGTERM signal while it'sexecuting a query.Maybe we can say that it's a bug that worker_spi could not respond toSIGTERM during query execution. But since worker_spi is a just exampleof the background worker code, we don't do the back-patch.Thanks to Craig Ringer for the report and investigation of the issue.Author: Bharath RupireddyReviewed-by: Fujii MasaoDiscussion:https://postgr.es/m/CALj2ACXDEZhAFOTDcqO9cFSRvrFLyYOnPKrcA1UG4uZn9hUAVg@mail.gmail.comDiscussion:https://postgr.es/m/CAGRY4nxsAe_1k_9g5b47orA0S011iBoHsXHFMH7cg7HV0O1bwQ@mail.gmail.com1 parent0926e96 commit2a08477
1 file changed
+9
-43
lines changedLines changed: 9 additions & 43 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| 28 | + | |
28 | 29 |
| |
29 | 30 |
| |
30 | 31 |
| |
| |||
48 | 49 |
| |
49 | 50 |
| |
50 | 51 |
| |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 | 52 |
| |
56 | 53 |
| |
57 | 54 |
| |
| |||
64 | 61 |
| |
65 | 62 |
| |
66 | 63 |
| |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 |
| - | |
91 |
| - | |
92 |
| - | |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 | 64 |
| |
100 | 65 |
| |
101 | 66 |
| |
| |||
179 | 144 |
| |
180 | 145 |
| |
181 | 146 |
| |
182 |
| - | |
183 |
| - | |
| 147 | + | |
| 148 | + | |
184 | 149 |
| |
185 | 150 |
| |
186 | 151 |
| |
| |||
219 | 184 |
| |
220 | 185 |
| |
221 | 186 |
| |
222 |
| - | |
| 187 | + | |
| 188 | + | |
223 | 189 |
| |
224 |
| - | |
| 190 | + | |
225 | 191 |
| |
226 | 192 |
| |
227 | 193 |
| |
| |||
242 | 208 |
| |
243 | 209 |
| |
244 | 210 |
| |
245 |
| - | |
| 211 | + | |
246 | 212 |
| |
247 |
| - | |
| 213 | + | |
248 | 214 |
| |
249 | 215 |
| |
250 | 216 |
| |
| |||
303 | 269 |
| |
304 | 270 |
| |
305 | 271 |
| |
306 |
| - | |
| 272 | + | |
307 | 273 |
| |
308 | 274 |
| |
309 | 275 |
| |
|
0 commit comments
Comments
(0)