https://bz.apache.org/bugzilla/show_bug.cgi?id=53555

--- Comment #62 from Stefan Fritsch <[email protected]> ---
(In reply to Yann Ylavic from comment #61)
> Anyway, there is possibly an issue with retained->total_daemons which is
> incremented (unconditionally) whenever a child is created (make_child), but
> not always decremented when one finishes (server_main_loop, depending on
> whether or not it died smoothly and it still uses a scoreboard slot).
> 
> IOW, I think this hunk:
>                  ps->quiescing = 0;
> +                retained->total_daemons--;
> 
> should probably be moved up here:
>          ap_wait_or_timeout(&exitwhy, &status, &pid, pconf, ap_server_conf);
>          if (pid.pid != -1) {
> +            retained->total_daemons--;

No, I think the code in the patch is correct: There is only one case where the
code will return from the function before reaching the "if (child_slot >= 0) {"
block which contains the "retained->total_daemons--;" line. And in this case
the whole server will exit, so correct counting is not an issue any more.

On the other hand, total_daemons must not be decremented if child_slot < 0,
because in this case the dead process was not a worker process (but e.g. a
cgid-process).

But this should be made clearer, either by rearranging the code or by adding
some comments.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to