Hi Monks,
I've got a mod_perl handler below...
<Location /session>
SetHandler modperl
PerlResponseHandler JSON::RPC::Server::Apache
PerlSetVar dispatch "Handler::API::Session"
PerlSetVar return_die_message 1
</Location>
In the handler, I call some class methods of a module that has a global database handle (to retain a persistent connection). I know I could use Apache::DBI but had some problems, and there shouldn't be any issues with keeping a dbh in a modules' namespace for re-use by any methods in that module.
The handler then does a couple of forks for the children to do some simultaneous actions, all of this works fine-ish. They do a CORE::exit once they've written data back to the parent.
I am however seeing some really strange behaviour, could this be caused by the dbh being copied to all children, then when they close they mess up the parent's one?
After giving apache a battering with Apache Benchmark, then trying a manual call, I see that when calling the handler, the process runs fine, but the time taken is reported as if it's the end of a previous process, ie, it completes in seconds when tailling the logs, but states it took 120 seconds.
I'm timing the handler with Time::HiRes::gettimeofday().
Any advice would be great, it's a really strange problem that I'm pulling my hair out over.
Cheers