[Koha-devel] mod_perl

Rick Welykochy rick at praxis.com.au
Thu Sep 17 07:07:46 CEST 2009


Joe Atzberger wrote:

> mod_perl is not currently supported.  I'm sure more detailed 
> documentation of the problems like this one that you encounter trying to 
> use it would be appreciated, but my sense is that some of Koha's 
> dependencies are in themselves not safe for mod_perl.  Caching strategy 
> currently focuses on Memoize and memcached.

Another concern moving to mod_perl regards indempotence
<http://en.wikipedia.org/wiki/Indempotent>

i.e.
"the property of operations in mathematics and computer science that means
  that multiple applications of the operation do not change the result"

In their current incarnation, I suspect that many of the Koha perl
scripts are not indempotent. No one is to blame. That is the way they
were designed: to be run once and removed from memory. If a non-indempotent
script remains cached in memory, then the data left over from a previous
web request could influence the outcome of the next web request, often
in unpredictable ways.

The way to fix this is ensure there is no global (file scope) data in
any of the Koha perl scripts or library modules, or if such data is
necessary that it can only be modified under a strict access regime
that guarantees indempotency.

If any closures are used (and they are, sometimes, inadvertently), they
could be bound to old or irrelevant data from one web request to the next.
A closure is basically an embedded subroutine that accesses a local
copy of data.

I mention this because of my own experiences moving from "run once" to
mod_perl scripting.

There is another side effect. If you are running several different versions
of Koha on the same Apache instance, perhaps via several VirtualHosts, and you
move all of them to mod_perl, then you are playing Russian roulette with the
cached library modules. The server will unpredictably load different versions
of Koha (if you have different versions installed) for varying web requests.
This has bitten me in the foot and is very difficult to diagnose without realising
that the situation can arise in the first place :)

cheers
rick


-- 
_________________________________
Rick Welykochy || Praxis Services

Be nice to us or we'll impose democracy on you.



More information about the Koha-devel mailing list