perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: hanging proxy and $base_server_pool->cleanup_register
Date Wed, 08 Dec 2004 22:21:22 GMT
Stas Bekman wrote:

> Without trying to figure out why this happens, I can now see that it was 
> clearly a mistake to expose this pool. Why? Because this pool is not 
> thread-safe (remember it's a global static variable).

Well, I've figured it out anyway.

We have (t/conf/extra.conf.in):

<IfDefine PERL_USEITHREADS>
     PerlInterpStart         1
     PerlInterpMax           2
     PerlInterpMinSpare      1
     PerlInterpMaxSpare      2
</IfDefine>

So there could be only 2 perl interpreters at most used at any given time 
(talking about the main perl interpreters pool here). If the two are busy 
any new requests will block.

Now cleanup_register() ties a perl interpreter and doesn't release it 
until that cleanup handler is run. So that call:
   $base_server_pool->cleanup_register(sub { Apache::OK });
was tieing an interpreter, but wasn't releasing it (since the pool is 
freed at the child_exit only). And therefore we had a lack of available 
interpreters and voilĂ  the problem we had that we all saw.

I'll fix that shortly in the way suggested in my previous followup.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message