perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
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/

     PerlInterpStart         1
     PerlInterpMax           2
     PerlInterpMinSpare      1
     PerlInterpMaxSpare      2

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     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message