+Parent option

+Parent option

am 22.07.2011 20:02:19 von Fred Moyer

Has anyone ever used the +Parent option with their mod_perl based system?

http://perl.apache.org/docs/2.0/user/config/config.html#C_Pa rent_

Have been trying to debug an issue where this error was being
encountered in JSON::XS based code with two virtual hosts, each with
their own +Parent interpreter pool:

panic: free from wrong pool at /My/Subclassed/JSON-XS-Class.pm

I'm guessing that some code refs were still shared between the
interpreter pools.

Re: +Parent option

am 23.07.2011 11:10:28 von Keywan Ghadami

Hi Fred,

i am using +Parent on debian lenny mpm_prefork
and on ubuntu 10.04 mpm_prefork i have hade no issues with JSON::XS

i use '+Parent' to use different Modules Versions (new versions of my
own modules) in a test environment (vhost) on the same server.

I have got some projects running with +Parent and JSON:XS in parallel,
but never got this error.
Do you use the default apache and mod_perl packages, which version you
are using?

But i have to acknowledge '+Parent' didn't work for me i some Situations.

a long time ago i tried to hold a database handle in a global package
variable
#######
package MyPackage
my $dbh;
#######

i thought it would be fine to do this with +Parent, but mod_perl didn't
separated it clearly, and things stared to become strange.
so i started to use something workarounds:
######
package MyPackage;
my $vhost_dbh = {};
sub handle{
#...
$vhost_key = $config->{'vhost_key'}
my $dbh = $vhost_dbh->{$vhost_key}
if (! defined $dbh ...
}
########

Maybe your are also relying on some globe variables in your code?

best regards keywan.


Am 22.07.2011 20:02, schrieb Fred Moyer:
> Has anyone ever used the +Parent option with their mod_perl based system?
>
> http://perl.apache.org/docs/2.0/user/config/config.html#C_Pa rent_
>
> Have been trying to debug an issue where this error was being
> encountered in JSON::XS based code with two virtual hosts, each with
> their own +Parent interpreter pool:
>
> panic: free from wrong pool at /My/Subclassed/JSON-XS-Class.pm
>
> I'm guessing that some code refs were still shared between the
> interpreter pools.


--
*Keywan Ghadami*
Entwicklung und Sicherheit

*ibson*
Fritz-Arnold-Str. 23
D-78467 Konstanz

Telefon +49 (0)75 31 / 81 39 7 93
Fax +49 (0)75 31 / 81 39 7 89