Re: 2.0 accept() error handling in Unix

2002-02-10 Thread Greg Ames

Greg Ames wrote:

had another look at worker 

> As it turns out, worker ignores the error and
> re-issues the accept().  

bzzzt! wrong...

if (rv == APR_EGENERAL) {
signal_workers();

which gracefully cleans up the child and exits without affecting the parent. 
hmmm, that's what   1.3 does too.  Both are treating should-not-occur programming
errors the same as resource shortages, but maybe that's not so bad.

I'll commit a patch in a bit to make prefork behave like worker and 1.3.

Greg



Re: 2.0 accept() error handling in Unix

2002-02-11 Thread Martin Kraemer

On Fri, Feb 08, 2002 at 04:02:03PM -0500, Greg Ames wrote:
> What I think we need is a new APR error category (APR_ENORESOURCE ?
> APR_ESICKCHILD ?), similar to APR_EGENERAL, that advises the MPM to cleanly shut
> down the child without affecting the parent.  This could be set in unixd_accept
> for things like EMFILE, ENFILE,  ENOBUFS, and ENOMEM, which deal with resource
> shortages.
> 
> Comments?  Better names for the new error category?

APR_ENORESOURCE indicates a temporary problem which may (or may not)
go away after some time. Currently, our only choice seems to be:
terminate the child only, or terminate the whole server (parent+children).
Neither is really appropriate, because restarting the child immediately
only will cause the same error again, and we end up in a fork/exit loop,
wasting cpu time.

IMO this situation asks for some kind of delay ("resource _temporarily_
unavailable, retry again in 2 minutes...").

Would a new child exit code "don't restart me immediately" (EX_SICKCHILD)
be feasible? But what if _all_ children have exited and signalled
EX_SICKCHILD to the parent? What should the parent do once it finds out
that no children are left, and restarting one returns the same error
over and over again? Sleep(10) and retry?

Yes, I think we should discuss these questions. And I know that 1.3
knew no clean answer to it either.

   Martin
-- 
<[EMAIL PROTECTED]> | Fujitsu Siemens
Fon: +49-89-636-46021, FAX: +49-89-636-47655 | 81730  Munich,  Germany