You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by victor <vi...@outblaze.com> on 2005/03/04 10:24:14 UTC

Problem using Cleanuphandler for SizeLimit

Hello everyone, I just bump into something strange I wonder if anyone 
else here have experienced it or better have a fix.

I have been using SizeLimit with FixupHandler since day one and it has 
been working wonderful, recently I noticed the documention have been 
changed now the CleanupHandler become the prefered choice of handler to 
handle SizeLimit.  So I've picked a stage machine, make the change and 
let it run overnight, expecting nothing to go wrong and looking forward 
to make the change standard in subsequence deployment.

I didn't have to wait very long, only after an hour or so, I start 
getting report that the box is acting 'funny', it starts rejecting  
requests and checking the log it seems some of the variables in the 
script being call, seems to be returning undefined.  Restarted apache, 
it seems to work fine for a while then it comes again.  I rolled back 
the change and a day has passed no more report of the problem have been 
reported since.

I am running mod_perl 1.29 here, with apache 1.3.27

Many thanks.

Tor.

-- 
<!---------------------------------------------
                           Victor
                           Development Engineer
                           Outblaze Ltd
---------------------------------------------->


Re: Problem using Cleanuphandler for SizeLimit

Posted by Perrin Harkins <pe...@elem.com>.
On Mon, 2005-03-07 at 17:22 +0800, victor wrote:
> I did a hard stop, actually though we turned on perfreshreseart we never 
> do 'restart' on apache, I have gone so far as of changing the apachectl 
> so restart actually stop and start the server.
> 
> I will try again with this turned off later today and see if I get any 
> complain tomorrow.

Okay.  It isn't a big deal if you don't want to change it.  The code
just does this if you call it from a FixupHandler:

$r->post_connection(\&exit_if_too_big);

- Perrin


Re: Problem using Cleanuphandler for SizeLimit

Posted by victor <vi...@outblaze.com>.
I did a hard stop, actually though we turned on perfreshreseart we never 
do 'restart' on apache, I have gone so far as of changing the apachectl 
so restart actually stop and start the server.

I will try again with this turned off later today and see if I get any 
complain tomorrow.

Tor.

Perrin Harkins wrote:

>On Mon, 2005-03-07 at 14:06 +0800, victor wrote:
>  
>
>>This is all I have in the config file
>>
>>PerlFreshRestart        On
>>    
>>
>
>Can you try without that?  I strongly advise against using
>PerlFreshRestart.  It can cause some very mysterious bugs.  Perl just
>isn't built to handle refreshing like this without shutting down.
>
>Did you do a hard stop and start when you changed this last time, or
>just count on PerlFreshRestart to work?
>
>- Perrin
>
>
>  
>


-- 
<!---------------------------------------------
                           Victor
                           Development Engineer
                           Outblaze Ltd
---------------------------------------------->


Re: Problem using Cleanuphandler for SizeLimit

Posted by Perrin Harkins <pe...@elem.com>.
On Mon, 2005-03-07 at 14:06 +0800, victor wrote:
> This is all I have in the config file
> 
> PerlFreshRestart        On

Can you try without that?  I strongly advise against using
PerlFreshRestart.  It can cause some very mysterious bugs.  Perl just
isn't built to handle refreshing like this without shutting down.

Did you do a hard stop and start when you changed this last time, or
just count on PerlFreshRestart to work?

- Perrin


Re: Problem using Cleanuphandler for SizeLimit

Posted by victor <vi...@outblaze.com>.
Hi Perrin, thanks very much for your reply.

This is all I have in the config file

PerlFreshRestart        On
PerlRequire             /usr/local/site/libperl/startup_for_proxy.pl
PerlFixupHandler        Apache::SizeLimit
#PerlCleanupHandler      Apache::SizeLimit
PerlTransHandler        My::setupVhost
PerlLogHandler          My::Logger

where setupVhost is a routine that lookup a local BerkelyDB and setup 
the DocuemtnRoot based on the incomming hostname. 

My::Logger is a very short and simple routine that capture return from 
our CGI script, usually detail about what this action the particular 
request is for, we use it for debugging.

Is there anything in these 2 functions that can possibly do something to 
the cleanup handler? 

Many thanks.

Tor.

Perrin Harkins wrote:

>On Fri, 2005-03-04 at 17:24 +0800, victor wrote:
>  
>
>>I have been using SizeLimit with FixupHandler since day one and it has 
>>been working wonderful, recently I noticed the documention have been 
>>changed now the CleanupHandler become the prefered choice of handler to 
>>handle SizeLimit.
>>    
>>
>
>It still does the same thing it always did, i.e. if you use any phase
>other than cleanup it just pushes a cleanup handler to run at the end of
>the request.  That seemed pointless to me, so I changed the
>documentation.
>
>  
>
>>I didn't have to wait very long, only after an hour or so, I start 
>>getting report that the box is acting 'funny', it starts rejecting  
>>requests and checking the log it seems some of the variables in the 
>>script being call, seems to be returning undefined.
>>    
>>
>
>I can't think of any reason that change would make a difference.  Do you
>have something else that might be trying to set a cleanup handler?
>
>- Perrin
>
>
>  
>


-- 
<!---------------------------------------------
                           Victor
                           Development Engineer
                           Outblaze Ltd
---------------------------------------------->


Re: Problem using Cleanuphandler for SizeLimit

Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2005-03-04 at 17:24 +0800, victor wrote:
> I have been using SizeLimit with FixupHandler since day one and it has 
> been working wonderful, recently I noticed the documention have been 
> changed now the CleanupHandler become the prefered choice of handler to 
> handle SizeLimit.

It still does the same thing it always did, i.e. if you use any phase
other than cleanup it just pushes a cleanup handler to run at the end of
the request.  That seemed pointless to me, so I changed the
documentation.

> I didn't have to wait very long, only after an hour or so, I start 
> getting report that the box is acting 'funny', it starts rejecting  
> requests and checking the log it seems some of the variables in the 
> script being call, seems to be returning undefined.

I can't think of any reason that change would make a difference.  Do you
have something else that might be trying to set a cleanup handler?

- Perrin