On Thu, Sep 11, 2014 at 6:32 PM, Robert Haas <robertmh...@gmail.com> wrote: > > Thanks for reviewing, Andres. > > On Thu, Sep 11, 2014 at 7:01 AM, Andres Freund <and...@2ndquadrant.com> wrote: > >> +static void bgreclaim_quickdie(SIGNAL_ARGS); > >> +static void BgreclaimSigHupHandler(SIGNAL_ARGS); > >> +static void ReqShutdownHandler(SIGNAL_ARGS); > >> +static void bgreclaim_sigusr1_handler(SIGNAL_ARGS); > > > > This looks inconsistent. > > It's exactly the same as what bgwriter.c does. > > > No LWLockReleaseAll(), AbortBufferIO(), ...? Unconvinced that that's a > > good idea, regardless of it possibly being true today (which I'm not > > sure about yet). > > We really need a more centralized way to handle error cleanup in > auxiliary processes. The current state of affairs is really pretty > helter-skelter. But for this patch, I think we should aim to mimic > the existing style, as ugly as it is. I'm not sure whether Amit's got > the logic correct, though: I'd agree LWLockReleaseAll(), at a minimum, > is probably a good idea.
Code related to bgreclaimer logic itself doesn't take any LWLock, do you suspect the same might be required due to some Signal/Interrupt handling? >From myside, I have thought about what to keep for error cleanup based on the working of bgreclaimer. However there is a chance that I have missed something. With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com