[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apache::Session::MySQL, light/heavy proxy, wedging


At 12:30 AM 1/31/2007 -0500, Perrin Harkins wrote:
As for what's going wrong, my guess is that it has to do with the
internal redirects that happen when you access / as opposed to
/index.phtml.  You are trying to open the session in the
HeaderParserHandler phase, so it's going to open a session, then do an
internal redirect, and try to open the same session again, effectively
deadlocking.

Wouldn't throwing a

        return DECLINED unless $r->is_initial_req;

at the top of the handler fix the problem, in that case?

That's a 2.0 doc, but it applies to 1.0 as well: pnotes() increases
the reference count to $session rather than copying it, so it doesn't
get destroyed until after the internal redirect has completed and
pnotes gets torn down.  If you use a temporary variable to hold the
_session_id key, this will not happen and that may fix your problem.

That occurred to me, and one of the first things that I tried was something like this:

        my $temp_session=$session{_session_id};
        $r->pnotes('SESSION_ID', $temp_session);

It didn't change anything, so I decided that either (a) that wasn't the problem, or (b) after years of doing this I *still* don't fundamentally understand references. Either conclusion made me uncomfortable, so I went looking for other potential solutions.



Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.