[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Help with $r being corrupted


I have encounter the same problem (at least the same symptoms) 

thread here:
http://marc.info/?l=apache-modperl&m=114226565622372&w=2

I have never been able to find a true solution, but it is very
intermittent.  I worked around it by doing this (which isn't really a
solution at all, and in fact borders on horrible).  It does however keep
the user from getting a 500 (they get nothing at all instead).  I kill
the child because the errors would usually come in clusters all from a
single apache child.

sub handler {
    my $r = shift;
    if ( !ref($r) || (ref($r) ne 'Apache' && ref($r) ne
'Apache::Request' && ref($r) ne 'Apache::Filter')){
       print STDERR 'pnotes error occuring '.__PACKAGE__.' - pid: ' . $$
. ' non-apache object: ' . ref($r) . "\n";
       Apache->request->child_terminate;
       return DONE;
    }
...

You might be able to work around it by doing something like this though
now that i think about it.

sub handler {
    my $r = shift;
    if ( !ref($r) || (ref($r) ne 'Apache' && ref($r) ne
'Apache::Request' && ref($r) ne 'Apache::Filter')){
        $r = Apache->request;
        $r->child_terminate; # i'd still kill off the child anyway
}

HTH

Adam


-----Original Message-----
From: Victor Danilchenko [mailto:suppressed 
Sent: Thursday, May 03, 2007 6:51 PM
To: Frank Wiles
Cc: suppressed
Subject: Re: Help with $r being corrupted

Frank Wiles wrote:

>    Actually it isn't an issue of methods being forgotten, more likely
>    you aren't using Apache2::RequestUtil in your code.  Preferably
>    preloading it. 

	Well, the production code which has this problem is running
under 
mod_perl 1 and Apache 1.3 right now, but I do load both Apache and 
Apache::Request there (the code is compatible with moth mod_perl and 
mod_perl2, I also load Apache2::RequestUtil in the Apache2 comaptibility

block), and the error still occurs.

	Is it some different module for Apache 1 that I am missing?
Though the 
fact that the error occurs only infrequently, and mostly in requests 
which occur over SSL, makes me suspect that it's something else.


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.