Re: Preventing hangups in bgworker start/stop during DB shutdown

2021-01-22 Thread Craig Ringer
On Fri, 25 Dec 2020 at 06:07, Tom Lane wrote: > I wrote: > > Bharath Rupireddy writes: > >> 4) IIUC, in the patch we mark slot->terminate = true only for > >> BGW_NEVER_RESTART kind bg workers, what happens if a bg worker has > >> bgw_restart_time seconds and don't we hit the hanging issue(that

Re: Preventing hangups in bgworker start/stop during DB shutdown

2020-12-24 Thread Tom Lane
I wrote: > Bharath Rupireddy writes: >> 4) IIUC, in the patch we mark slot->terminate = true only for >> BGW_NEVER_RESTART kind bg workers, what happens if a bg worker has >> bgw_restart_time seconds and don't we hit the hanging issue(that we >> are trying to solve here) for those bg workers? > T

Re: Preventing hangups in bgworker start/stop during DB shutdown

2020-12-24 Thread Tom Lane
Bharath Rupireddy writes: > On Wed, Dec 23, 2020 at 3:10 AM Tom Lane wrote: >> Here's an attempt at closing the race condition discussed in [1] >> (and in some earlier threads, though I'm too lazy to find them). > 2) What if postmaster enters pmState >= PM_STOP_BACKENDS state after > it calls Ba

Re: Preventing hangups in bgworker start/stop during DB shutdown

2020-12-24 Thread Bharath Rupireddy
On Wed, Dec 23, 2020 at 3:10 AM Tom Lane wrote: > Here's an attempt at closing the race condition discussed in [1] > (and in some earlier threads, though I'm too lazy to find them). > > The core problem is that the bgworker management APIs were designed > without any thought for exception conditio

Re: Preventing hangups in bgworker start/stop during DB shutdown

2020-12-22 Thread Craig Ringer
On Wed, 23 Dec 2020 at 05:40, Tom Lane wrote: > Here's an attempt at closing the race condition discussed in [1] > (and in some earlier threads, though I'm too lazy to find them). > > The core problem is that the bgworker management APIs were designed > without any thought for exception condition