httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@lnd.com>
Subject RE: logging APR errors
Date Mon, 17 Jul 2000 18:55:29 GMT
> From: rbb@covalent.net [mailto:rbb@covalent.net]
> Sent: Monday, July 17, 2000 1:35 PM
> 
> On Mon, 17 Jul 2000, Jeff Trawick wrote:
> 
> > V. A few comparisions with other approproaches
> > 
> > A. In what ways does this improve on having APR build a string and
> >    making it accessible to the application?
> > 
> >    i. Some interesting work is required to make sure we record
> >    information on all syscall failures if we build a single string
> >    (or if we build a list/stack of strings).
> > 
> >    ii. We build a string even if nobody cares.
> 
> This design doesn't solve this problem, in fact, IMNSHO it makes it
> worse.  Think of it this way.  What if Apache doesn't want to log on a
> given error.  Say for ap_sendfile, there is at least one condition we
> don't want to log, but it requires the ability to make the call-back
> (otherwise we are Apache centric).  Apache must de-register the callback
> before calling ap_sendfile.  And then re-register it after calling
> ap_sendfile, or Apache will need to register/de-register before EVERY APR
> call.  There is only one way aroung this, which is to only make the
> callback in the cases Apache cares about, which ties APR to Apache, which
> is a BIG no-no.

Wrong.  If we design this correctly, the error handler is actually a stack.
Push a null handler on the stack and pop it after the call.  Only the top
handler on the stack gets the error, so no log files are actually hurt in
this production.  If the error handler stack is presized and never really
shrinks, reallocation is minimal once the thread has cranked through a few
tough, nested calls.  This design, however, can be pretty bad on registration
within call nesting, and those have to be watched.

This allows anyone to raise an error, a predecessor to catch and throw it
again at a lower point in the stack.  Whereever we simply -don't care-
(and there will be many examples even within APR itself) then we can catch
and drop the error, or catch and transform if the error is meaningless to
the lowest predecessor.

Bill

Mime
View raw message