forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbf740ce
committed
Fix status reporting for terminated bgworkers that were never started.
Previously, GetBackgroundWorkerPid() would return BGWH_NOT_YET_STARTEDif the slot used for the worker registration had not been reused byunrelated activity, and BGWH_STOPPED if it had. Either way, a processthat had requested notification when the state of one of itsbackground workers changed did not receive such notifications. Fixthings so that GetBackgroundWorkerPid() always returns BGWH_STOPPED inthis situation, so that we do not erroneously give waiters theimpression that the worker will eventually be started; and sendnotifications just as we would if the process terminated after havingbeen started, so that it's possible to wait for the postmaster toprocess a worker termination request without polling.Discovered by Amit Kapila during testing of parallel sequential scan.Analysis and fix by me. Back-patch to 9.4; there may not be anyonerelying on this interface yet, but if anyone is, the new behavior is aclear improvement.1 parent417f78a commitbf740ce
1 file changed
+24
-1
lines changedLines changed: 24 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
244 | 244 |
| |
245 | 245 |
| |
246 | 246 |
| |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
247 | 252 |
| |
248 | 253 |
| |
249 | 254 |
| |
250 | 255 |
| |
251 |
| - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
252 | 263 |
| |
253 | 264 |
| |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
254 | 274 |
| |
| 275 | + | |
| 276 | + | |
| 277 | + | |
255 | 278 |
| |
256 | 279 |
| |
257 | 280 |
| |
|
0 commit comments
Comments
(0)