On 12/3/21 1:18 AM, Yann Ylavic wrote:
> On Thu, Dec 2, 2021 at 9:07 PM Ruediger Pluem <rpl...@apache.org> wrote:
>>
>> On 12/2/21 7:31 PM, Yann Ylavic wrote:
>>>
>>> Full patch attached, we need to retain active_daemons too for this to
>>> work actually.
>>>
>>
>> Why do we need to retain active_daemons? When we get back after a restart 
>> there should be no active daemons any longer. They
>> should be all gone or shutting down. The only active daemons we should have 
>> then should be the ones of the new generation.
> 
> Retaining active_daemons probably does not belong to the same patch
> than the MaxSpareThreads changes (like I did), but it looks like
> restarting (gracefully or not) with active_daemons = 0 is not correct
> because the first call to perform_idle_server_maintenance() will find
> the stopping processes old gen and do:
>         ps = &ap_scoreboard_image->parent[i];
>         if (ps->pid != 0) {
>             int child_threads_active = 0;
>             if (ps->quiescing == 1) {
>                 ps->quiescing = 2;
>                 active_daemons--;
>             }
>             ...
>         }
> Thus doubly account for the stopping daemons and leaving
> active_daemons as a negative value?
> 
> I think that since r1893520 and the correct accounting of
> active_daemons throughout perform_idle_server_maintenance() we'd
> better let perform_idle_server_maintenance() handle
> retained->active_daemons entirely.
> 
> Am I missing something?

So the idea is that once we ran through perform_idle_server_maintenance the 
first time the retained active_daemons number will be
correct again?
It looks like we don't rely on active_daemons to be correct before this. Hence 
this should be working. More so: As you state if we
don't retain active_daemons the counter will become negative and wrong. Good 
catch.

Regards

RĂ¼diger

Reply via email to