I'm using Apache::Session within a large Web application (consisting of many
scripts).  We also have multiple developers on this project, some of whom
are junior developers with only a bit of mod_perl experience.

In any case, I've written a custom session package that wraps to
Apache::Session.  It uses Apache::Session for persistence, but it adds nice
functionality to it (cookies, session time-out, etc.).

Normally, this works great.  No problem at all.  This object goes out of
scope at the end of the script (it's scoped lexically with "my").  It also
goes out of scope when "die" is explicitly called.  If I add "die 'Blah blah
blah'" to an app, things are fun.  BUT... sometimes when there's a syntax
error in the code, this object just stays in scope.  This causes a real
problem, because then the developer will just re-load.  The process will sit
there forever, waiting for the session lock to go away.  But it never
does...

This is a problem.  Under certain strange circumstances, the object does not
go out of scope.  Even under PerlRun (which I *thought* would clear the
application's namespace at the end of execution), the object stays in scope
(I print to STDERR in DESTROY to see this).

The mod_perl server starts going crazy spawning off new threads for each
request, because current threads are busy.  I placed some limits on this in
httpd.conf, but this is not really a solution.  The only solution is to
restart the server... But there's gotta be a better way!

This has been plaguing us for a while, and I can't figure it out.  I was
considering writing a $SIG{__DIE__} handler that would take this object out
of scope, but I ran into other issues there.  Has anyone else run into this
problem?

Any suggestions?

Thanks,
Russ

Russell Weiss
Founder and Technical Manager
InfoRelay Online Systems, Inc.
http://www.InfoRelay.net/


Reply via email to