On Tue, Mar 12, 2024 at 8:48 AM Yann Ylavic <ylavic....@gmail.com> wrote:
>
> On Tue, Mar 12, 2024 at 1:06 PM Eric Covener <cove...@gmail.com> wrote:
> >
> > On Mon, Mar 11, 2024 at 8:28 PM <cove...@apache.org> wrote:
> > >
> > > Author: covener
> > > Date: Tue Mar 12 00:28:34 2024
> > > New Revision: 1916243
> > >
> > > URL: http://svn.apache.org/viewvc?rev=1916243&view=rev
> > > Log:
> > > use graceful exit if lister started
> > >
> > > Modified:
> > >     httpd/httpd/trunk/server/mpm/event/event.c
> > >
> > > Modified: httpd/httpd/trunk/server/mpm/event/event.c
> > > URL: 
> > > http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1916243&r1=1916242&r2=1916243&view=diff
> > > ==============================================================================
> > > --- httpd/httpd/trunk/server/mpm/event/event.c (original)
> > > +++ httpd/httpd/trunk/server/mpm/event/event.c Tue Mar 12 00:28:34 2024
> > > @@ -2749,7 +2749,7 @@ static void *APR_THREAD_FUNC start_threa
> > >                               APLOGNO(03104)
> > >                               "ap_thread_create: unable to create worker 
> > > thread");
> > >                  /* let the parent decide how bad this really is */
> > > -                signal_threads(ST_UNGRACEFUL);
> > > +                signal_threads(listener_started ? ST_GRACEFUL : 
> > > ST_UNGRACEFUL);
> > >                  clean_child_exit(APEXIT_CHILDSICK);
> > >              }
> >
> > Maybe this option is silly, if we are going to nearly immediately
> > clear pchild and call exit().
>
> Maybe it could be:
>     if (threads_created) {

not listener_started?

threads_started>0  could just mean we had no scoreboard issues but
pthread_create failed on anything but the first thread.

>         resource_shortage = 1;
>         signal_threads(ST_GRACEFUL);
>         break;

I think this would have us still outer looping to keep trying to create threads?

>     }
>     clean_child_exit(APEXIT_CHILDSICK);

>> We should probably prevent the listener from starting too, like:

Could be confusing, maybe we can instead dodge creating the listener
if resource_shortage=1?

-- 
Eric Covener
cove...@gmail.com

Reply via email to