httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Chris \(MDW\)" <chris.john...@morris.com>
Subject Information Request: Graceful error handling in modules
Date Wed, 11 Apr 2007 14:59:18 GMT
I am looking for pointers to information/examples on how to have my
module (which is a content generator) gracefully interact with Apache in
error conditions, specifically timeout errors, which I would like my
module to handle.

Nick's book has some information in chapters 5 and 6 but I would like to
find code examples with discussion if possible. I am also working on
searching through the mod_perl sources and the Apache sources.

I would like for my module to receive notification of the timeout upon
which I will abort my current processing (including some notification to
Oracle to abort the currently running query) and either generate an
error page or redirect to an error URL.

My module is written in C, the questions I am looking to answer are:

1. From the standpoint of Apache, is this considered successful request
processing?
2. Is attempting to interrupt the normal timeout handling of Apache bad
practice?
3. What is the correct way to register my timeout handler
(signal/sigaction/ap_set_callback_and_alarm/apr_signal)? The module is
for Apache 2.0 currently and the ap_set_callback_and_alarm function
appears to have been a 1.3 construct.
4. What is the impact of using alarm(#) in my code? It currently appears
to squash any configured timeout for Apache.
5. Once I have finished my timeout processing, is there a standard way
to abort my module (effectively long jump back to the hook function so I
can return control back to Apache)?
6. If it does become necessary, is there a way to ask Apache to dispose
of the current child process after it finishes processing?

I have Nick's Apache Modules book which I am still working through.
Recommendations about questions I should be asking are also welcome.

Thanks,
Chris Johnson

Mime
View raw message