LP#
1953057: improve reset-after-crash handling for Perl apps
This patch more forcibly reaps children and resets the active
and idle lists after an uncaught exception in the main run
method triggers a reset of the service. This avoids an issue
where such a reset would result in the listener thinking it
has more running drones than is actually the case, which can
make it think it's hit max_children limits sooner than is actually
the case.
To test
-------
[1] Do something to arrange for a busy Perl service to throw
an exception in the listener, such as setting up a replication
of bug
1953044 or adding code to cause the listener to randomly
throw an exception.
[2] Observe that the listener does not fully clean up the drones
it has at the point of the crash, and consequently may think
post-reset that it is closer to the max_children limit than
is actually the case. One symptom of this is requests getting
added to the backlog queue unecessarily.
[3] Apply the patch and repeat step 1. This time, the service should
reset itself properly and handle requests and drones post-reset
as expected.
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>