Re: [HACKERS] Making BackgroundWorkerHandle a complete type or offering a worker enumeration API?

2014-12-15 Thread Robert Haas
On Sat, Dec 13, 2014 at 4:13 AM, Craig Ringer cr...@2ndquadrant.com wrote: While working on BDR, I've run into a situation that I think highlights a limitation of the dynamic bgworker API that should be fixed. Specifically, when the postmaster crashes and restarts shared memory gets cleared

Re: [HACKERS] Making BackgroundWorkerHandle a complete type or offering a worker enumeration API?

2014-12-15 Thread Craig Ringer
On 12/16/2014 12:12 AM, Robert Haas wrote: On Sat, Dec 13, 2014 at 4:13 AM, Craig Ringer cr...@2ndquadrant.com wrote: While working on BDR, I've run into a situation that I think highlights a limitation of the dynamic bgworker API that should be fixed. Specifically, when the postmaster crashes

Re: [HACKERS] Making BackgroundWorkerHandle a complete type or offering a worker enumeration API?

2014-12-15 Thread Robert Haas
On Mon, Dec 15, 2014 at 11:28 AM, Craig Ringer cr...@2ndquadrant.com wrote: If that's not good for some reason, my second choice is adding a BGWORKER_UNREGISTER_AFTER_CRASH flag. That seems much simpler and less cumbersome than your other proposal. That'd be my preference. OK, let's do

Re: [HACKERS] Making BackgroundWorkerHandle a complete type or offering a worker enumeration API?

2014-12-15 Thread Craig Ringer
On 12/16/2014 12:31 AM, Robert Haas wrote: On Mon, Dec 15, 2014 at 11:28 AM, Craig Ringer cr...@2ndquadrant.com wrote: If that's not good for some reason, my second choice is adding a BGWORKER_UNREGISTER_AFTER_CRASH flag. That seems much simpler and less cumbersome than your other

[HACKERS] Making BackgroundWorkerHandle a complete type or offering a worker enumeration API?

2014-12-13 Thread Craig Ringer
Hi all While working on BDR, I've run into a situation that I think highlights a limitation of the dynamic bgworker API that should be fixed. Specifically, when the postmaster crashes and restarts shared memory gets cleared but dynamic bgworkers don't get unregistered, and that's a mess. I have