forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit76d07a2
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 parent904e8b6 commit76d07a2
1 file changed
+24
-1
lines changedLines changed: 24 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
245 | 245 |
| |
246 | 246 |
| |
247 | 247 |
| |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
248 | 253 |
| |
249 | 254 |
| |
250 | 255 |
| |
251 | 256 |
| |
252 |
| - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
253 | 264 |
| |
254 | 265 |
| |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
255 | 275 |
| |
| 276 | + | |
| 277 | + | |
| 278 | + | |
256 | 279 |
| |
257 | 280 |
| |
258 | 281 |
| |
|
0 commit comments
Comments
(0)